【问题标题】:Make new applescript in selected folder在选定的文件夹中创建新的小程序
【发布时间】:2010-10-26 04:12:03
【问题描述】:

如何使用 AppleScript/Automator 来创建一个服务,在所选文件夹中创建一个空的 AppleScript 文件?

【问题讨论】:

    标签: applescript automator


    【解决方案1】:

    您想使用命令行实用程序 osacompile。以下将在您的桌面上创建一个名为“test.scptd”的空白applescript

    set applescriptCode to ""
    set applescriptPath to (path to desktop as text) & "test.scptd"
    
    do shell script "echo " & applescriptCode & " | osacompile -o " & quoted form of POSIX path of applescriptPath
    

    【讨论】:

    • 非常感谢,但我不断收到此错误:错误“Finder 出现错误:osacompile: 无法写入文件 /Library/Application Support/App/Scr​​ipt.scpt: No such file or目录”编号 1
    • 这个错误听起来像是你的路径有问题。由于您没有显示任何代码,我无法确定。我确定我的代码可以按原样运行,所以无论您更改什么都会搞砸。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-18
    • 1970-01-01
    • 1970-01-01
    • 2010-12-18
    • 2013-01-04
    • 2014-01-16
    相关资源
    最近更新 更多