我已经使用Alfred设置了工作流程。工作流程打开了一堆应用程序。作为此工作流程的一部分,我还希望Stay将窗口位置恢复为我创建的预设排列。
对于Stay,我使用“全局”键盘命令Shift+⌘</kbd> + Å to restore the windows. This keyboard shortcut is set in the application's preferences.
我NSAppleScript
在 Alfred 中创建了这个:
on alfred_script(q)
delay 5
tell application "System Events"
keystroke "Å" using shift down, command down
end tell
activate application "Evernote"
end alfred_script
但是,我无法让它工作。根据 Alfred 工作流程调试,我收到了这些错误:
[ERROR: alfred.workflow.action.applescript] {
NSAppleScriptErrorBriefMessage = "Expected end of line but found \U201c,\U201d.";
NSAppleScriptErrorMessage = "Expected end of line but found \U201c,\U201d.";
NSAppleScriptErrorNumber = "-2741";
NSAppleScriptErrorRange = "NSRange: {92, 1}";
}