您建议使用哪些资源来获取AppleScript.我带有Objective-C背景的传统C/C++.
我也在寻找有关如何更好地开发和从脚本编辑器获得更快文档的技巧.示例提示将是"查找要编写脚本的应用程序的sdef文件".
我需要从命令行"重新加载"Safari扩展(稍后再构建包).
如何才能做到这一点?
我想一步到位 - 我的代码是在CoffeeScript中,因此无论如何我都在编译它.
除了谷歌搜索无望,我尝试使用这个AppleScript:
tell application "System Events"
tell process "Safari"
click the button "Reload" of window "Extension Builder"
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
出了哪些错误:
系统事件出错:无法获取进程"Safari"的窗口"Extension Builder"的"重新加载"按钮.
而这种变化:
tell application "System Events"
tell process "Safari"
tell button "Reload" of window "Extension Builder" to perform action
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
哪个不会给出错误,但实际上也没有做任何事情.
我想tell application "Finder" to open POSIX file */path/to/somefilename*从C++程序执行Applescript命令.看起来我可能想要使用OSACompileExecute,但我无法找到如何使用它的示例.我一直在寻找如何使用OSACompileTerminal命令的示例.有人可以提供示例或示例链接吗?
假设我有两个应用程序在运行; 应用程序A和应用程序B.当应用程序A关闭时,让应用程序B自动关闭的最简单方法(或者确实存在)是什么?请注意,这些应用程序都不是由我开发的,因此我无法控制其内部行为.
我愿意接受任何建议,包括那些需要使用Applescript,Automator,终端命令和BASH脚本的建议.我甚至会考虑开发一个轻量级的Mac OS X应用程序来实现这一目标.
我厌倦了不断创建图像,然后必须复制,调整大小和重命名以支持视网膜和非视网膜iphone.如果只是将图像拖到脚本中,是否可以自动执行此脚本?
将调用原始图像:image@2x.png ...我希望脚本将其缩小50%并在结尾处删除"@ 2x".
提前致谢
我正在尝试使用带有以下代码的applescript来获取桌面窗口的边界:
tell application "Finder"
get bounds of window of desktop
end tell
Run Code Online (Sandbox Code Playgroud)
我一直得到"执行错误:Finder收到错误:无法获得桌面窗口的界限.( - 1728)".
我正在跑狮子.知道我怎么能让这个工作吗?
我正在尝试编写一个记录当前应用程序的脚本,切换到另一个应用程序,执行某项任务,然后返回到原始应用程序.这就是我所拥有的
set currentApp to my getCurrentApp()
activate application "Safari"
# Some task
activate application currentApp
to getCurrentApp()
set front_app to (path to frontmost application as Unicode text)
set AppleScript's text item delimiters to ":"
set front_app to front_app's text items
set AppleScript's text item delimiters to {""} --> restore delimiters to default value
set item_num to (count of front_app) - 1
set app_name to item item_num of front_app
set AppleScript's text item delimiters to "."
set app_name to app_name's text …Run Code Online (Sandbox Code Playgroud) 我想制作一个简单的程序,每次在UI后面登录时运行.在我的AppleScript中,我正在运行一个需要管理员身份验证的sudo命令.有没有办法在每次运行时覆盖身份验证的需要?每次登录后运行此脚本时,我都不想输入用户名和密码.任何帮助?(而且非常简单,因为我是新手.)非常感谢!
我正在尝试将Applescript设置为Xcode 4中的行为,但Xcode不允许我选择我的脚本.什么样的文件是Xcode的有效脚本?我试过.applescript,.scpt和.txt.我也没试过任何扩展.
我需要做什么?
我不得不做一个Applescript,到最后我只想运行一个python脚本.
我写
do shell script "/Users/Tom/Desktop/ayscript.py"
Run Code Online (Sandbox Code Playgroud)
但据说"许可被拒绝"
任何的想法 ?
applescript ×10
macos ×3
terminal ×2
appleevents ×1
c++ ×1
file-format ×1
iphone ×1
python ×1
xcode ×1