2016-07-29 2 views
0

私はXcodeを初めて、AppleScriptを使用していますAppleScriptに基づくMac OSアプリ

XcodeアプリケーションでAppleScriptを実行するだけです。これは可能ですか?

Bassically、アプリケーションがExcelでURLリストから画像をダウンロードし、Excel

に事前に感謝し、リストをacordingファイルの名前を変更しています! ドイツからのご挨拶!ここで

は、AppleScriptのコードです:Xcodeで

tell application "Microsoft Excel" 
    set filenames to value of every cell of range "K3:K200" of sheet "Image_Moves" of document 1 
    set URLs to value of every cell of range "L3:L200" of sheet "Image_Moves" of document 1 
end tell 

repeat with i from 1 to count URLs 
    if (item i of filenames is not missing value) and (item i of URLs is not missing value) then 
    set thisFname to quoted form of (POSIX path of ({path to desktop, "Image_Moves:"} as text) & item i of filenames) 
    set thisUrl to quoted form of item i of URLs 
    set status to (do shell script "curl -s -o " & thisFname & space & thisUrl) 
    end if 
end repeat 

try 
    tell application "Finder" 
    delete (every item of folder ("Image_Moves") whose name begins with "0") 
    end tell 
on error 
    display dialog ("Error. Couldn't Move the File") buttons {"OK"} 
end try 
+0

あなたの問題は不明です。 Xcodeとはどのような関係がありますか? Xcodeアプリケーションとは何ですか? – Eiko

+0

Eiko、私はApplescriptのバージョンを持っていて、それをMac OSのアプリに変えたいと思っています。それはXcodeにどのように関係していますか?まあ、私が知っていることから、あなたはXコードでこれを行うことができます、そうですか? – AnotherUser31

答えて

1

、あなたは "ココア・AppleScriptの" テンプレートではAppleScriptで、完全なアプリケーションを書くことができます。また、NSAppleScriptクラスを使用してAppleScriptをコンパイルして実行することもできます。あなたの質問がAppleScriptの実行可能ファイルを作成するだけの場合は、「スクリプトエディタ」で「名前を付けて保存」を使用し、AppleScriptをアプリケーションとして保存してください。

HTH

+0

SteffXありがとう、NSAppleScriptクラスでAppleScriptをコンパイルする手助けができたらとてもうれしいです。どうぞよろしくお願いします – AnotherUser31

関連する問題