2016-07-29 49 views
0

的Mac OS的应用程序我是新来了Xcode作为以及我对AppleScript的基于AppleScript的

所有我需要的是在Xcode应用程序运行AppleScript。这可能吗 ?

Bassically,下载应用软件从Excel中的一个URL列表图片和重命名这些文件acording在Excel

名单提前

谢谢! 来自德国的问候!

这里是AppleScript的代码:

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-Code来做到这一点,对吧? – AnotherUser31

回答

1

在Xcode中,你可以写在AppleScript的与 “可可AppleScript的” 模板完整的应用程序。另外,您可以使用NSAppleScript类编译和执行AppleScript。如果您的问题仅仅是制作AppleScript可执行文件,请在脚本编辑器中使用另存为...并将AppleScript保存为应用程序。

HTH

+0

谢谢SteffX,如果你可以帮助我用NSAppleScript类编译我的Applescript,我会非常高兴。请请求 – AnotherUser31