我使用RubyMine已经有几年了,最近才发现我可以用RubyMine编写AppleScripts(而不是Apple Script Editor)。
但我习惯在RubyMine中编写Gherkin并将步骤连接到'Ruby',所以现在我需要学习如何将我的步骤连接到AppleScript命令(以及如何组织结构)。
所以我的Gherkin步骤看起来像是:
Scenario: Open / Close Osirix
Step: Open Osirix <<< links to Applescript code (on Open Osirix)
Step: Quit Osirix
我的AppleScripts将是
on OpenOsirix
tell application "OsiriX" to activate
end OpenOsirix
on CloseOsirix
tell application "Osirix"
delay 1
quit
end tell
end CloseOsirix