AppleScript

一、资源

  1、书本

  2、ide: AppleSreipt Editor

  3、界面辅助软件: UIBrowser

    破解方法: a) ui browser -> show package contents -> open info.plist, found “bundle id” and remember it

          b) remove file users/xxx/Libaray/Preferences/bundle_id.plist

    注意: 这里的破解方法,暂时还没有得到验证,因为我安装的时间还不够 30 天,但是我删除了该文件,ui browser 仍然能正常运行。

二、杂七杂八笔记

  1、在保存的时候,选择“Run - only” 前,一定要先备份,一旦选择了脚本将不能再被编辑。

  2、注解的表达有两种

    -- xxxxxxxx

    (* xxxxxxxx *)

  3、run 的时候发生了错误 "System Events got an error: AppleScript Editor is not allowed assistive access."

    Solution:System Preference -> Security & Privacy -> click AppleScript Editor

  4、文件相对路径

    a) path to me: 当前文件所在目录

set folderPath to parent of (path to me) as string

set filePath to (POSIX path of folderPath) & "fileName.extension"

    b) POSIX path of path 能够把地址由 aaa:bob:ccc 转变为 aaa/bbb/ccc

  

原文地址:https://www.cnblogs.com/eileenleung/p/3492143.html