我想从命令行启动一个应用程序,并立即将 XCode 4 中的图形调试器附加到它,而无需单击 Xcode 菜单“产品”->“附加到进度”。是否可以使用 bash 或 Apple 脚本编写此脚本?

所以我有一个显示对话框的 Applescript,然后自动机将变量设置为条目
例子 。. . 输入“AAAAAAA”查询变量将是“AAAAAAA”
我正在尝试找出一种在运行我的下一个 applescript 时调用变量的方法
我知道如何通过使用 sys.argv 1和 stdin -> 参数来使用 Python shell 脚本
我怎样才能用 Applescript 实现这一点?
我看到了一个类似的帖子标题,但答案没有解决这个问题
我是 applescript 甚至这个社区的新手,所以这个问题似乎很奇怪。如果是这样,我很抱歉。但是我在谷歌搜索中找不到答案。所以让我问一下。
当我运行代码时
tell application "Evernote"
set theNote to item 1 of selection
set theTitle to (title of theNote)
end tell
Run Code Online (Sandbox Code Playgroud)
我收到一个错误,说
/var/folders/fm/k76y42cs1y98bjwfyf951q1r0000gn/T/vbkvTSQ/55:47:53: execution error: Evernote got an error: Can’t make item 1 of selection into type specifier. (-1700)
Run Code Online (Sandbox Code Playgroud)
但如果我跑到下面
tell application "Evernote"
set theNote to (selection)
set theNote to item 1 of theNote
set theTitle to (title of theNote)
end tell
Run Code Online (Sandbox Code Playgroud)
我可以得到预期的结果。
为什么会发生这个错误?我看不到两个代码的区别。
我正在尝试使用 applescript 打开一个非常大的 excel 文件 (*.xls)。代码非常简单,看起来可以正常工作,但是几分钟后我收到以下消息:
结果:错误“Microsoft Excel 出现错误:AppleEvent 超时。” 编号-1712
关于如何解决它的任何想法?顺便说一句,使用自动机也不起作用。
这是我的代码
tell application "Microsoft Excel"
activate
open "/Users/sergioguerra1/Desktop/Detektor/Etapa II/Reporte General.xls"
delay 300
end tell
Run Code Online (Sandbox Code Playgroud) 我的脚本在网站上搜索歌曲,但是当有空格时它不会搜索,您必须添加下划线。我想知道是否有办法用下划线替换我的空格。你能不能用我现在的代码告诉我怎么做?
set search to text returned of (display dialog "Enter song you wish to find" default answer "" buttons {"Search", "Cancel"} default button 1)
open location "http://www.mp3juices.com/search/" & search
end
Run Code Online (Sandbox Code Playgroud) 我开始尝试在 OS X Yosemite 中将我的一些 AppleScript 转换为 JavaScript,但我不明白我应该如何从应用程序访问枚举。例如 - Adium 的状态。
在 AppleScript 中:
tell application "Adium"
if status type of global status is offline then
log "offline"
end if
end tell
Run Code Online (Sandbox Code Playgroud)
在 JavaScript 中,我不知道如何访问“离线”枚举:
if(Application('Adium').globalStatus.statusType == ?????) {
console.log("offline");
}
Run Code Online (Sandbox Code Playgroud)
我尝试过简单的事情,比如“离线”,但没有成功。所有这些都是错误:
Application('Adium').StatusType("offline"); // error
Application('Adium').StatusType.offline; // undefined
Application('Adium').StatusType.make({name:"offline"}); // error
Run Code Online (Sandbox Code Playgroud)
有人得到过这样的工作吗?
javascript macos applescript osx-yosemite-beta javascript-automation
如何在 OS X JavaScript 中监听事件以实现自动化。
在消息应用程序的脚本库中有一个事件处理程序列表,例如messageSent和messageReceived。但是,我无法弄清楚如何使用它们。尝试传递函数会产生错误,而尝试将这些变量设置为新函数会导致 REPL 挂起。
设置这些事件处理程序的正确方法是什么?
javascript macos applescript automation javascript-automation
我有一个作为状态栏应用程序运行的 OS X 应用程序。我正在尝试进行测试自动化。有没有办法使用 Apple Script 单击状态栏应用程序?
下面给出的脚本仅适用于本机应用程序。
tell application "System Events" to tell process "SystemUIServer" to click menu bar item 1 of menu bar 1
Run Code Online (Sandbox Code Playgroud)
我正在寻找自定义应用程序上的类似功能。
使用 AppleScript,我可以使用以下命令调用 shell 脚本:
do shell script "echo 'Foo & Bar'"
Run Code Online (Sandbox Code Playgroud)
但是我在 Yosemite Script Editor 中找不到使用 JavaScript 的方法。
我经常使用 Applescript 来完成基本任务,比如打开和关闭程序,有时会更深入一些,比如运行特定的 Xcode 程序的单元测试。我正在学习 Python,我喜欢它。我没能找到很多关于 AppleScript 和 Python 的文档。我的问题是:在 Mac OS X 上,可以使用 Python 代替 AppleScript 来完成上述任务吗?如果是这样,有没有人知道一个很好的资源来了解有关该主题的更多信息?
applescript ×10
macos ×5
javascript ×3
automation ×2
arguments ×1
automator ×1
debugging ×1
excel ×1
process ×1
python ×1
shell ×1
testing ×1
urlencode ×1
variables ×1
xcode ×1