Applescript 和 'notes':在新 window 中打开笔记
Applescript and 'notes': Open note in new window
在 'Notes' 中,可以通过在笔记列表中双击它来在新的 window 中打开某个笔记(并且左侧的笔记概览不可见) .
一定有办法通过 applescript 做到这一点...即使经过很长时间的研究,我也找不到任何与该问题相关的内容。
有知道怎么做的吗?
使用普通的 AppleScript 除了使用 UI Scripting 之外,没有其他编程方式。请注意,这还需要提供例如脚本编辑器,或者 运行 AppleScript code, accessibility privileges 这样才能正常工作。
你需要通过name
或id
告诉Notes到show
note
然后使用系统事件 单击 浮动选定的注释 菜单项 Window 菜单 of Notes.
tell application "Notes"
show note "Foobar"
activate
end tell
delay 0.5
tell application "System Events" to ¬
tell application process "Notes" to ¬
click menu item "Float Selected Note" of ¬
menu 1 of ¬
menu bar item "Window" of ¬
menu bar 1
注意:将Foobar
改为note
的name
你想在单独的window中打开或者使用其 id
,例如:
note id "x-coredata://C48EA527-911C-49D0-950F-A15229B7D58F/ICNote/p55"
您还可以通过 number 告诉 Notes 到 show
a note
并且还包括 [= account
的 15=] 以及 folder
的 name
(如果适用),例如:
tell application "Notes"
tell account "Name"
tell folder "Name"
show note 1
end tell
end tell
end tell
注意:将Name
替换为对象的实际名称。根据需要更改 note
的 number。
然后使用系统事件 命令点击目标菜单项.
注意:示例 AppleScript code 就是这样,不包含任何可能适当的错误处理。用户有责任根据需要添加任何 错误处理 。看看 try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.
在 'Notes' 中,可以通过在笔记列表中双击它来在新的 window 中打开某个笔记(并且左侧的笔记概览不可见) .
一定有办法通过 applescript 做到这一点...即使经过很长时间的研究,我也找不到任何与该问题相关的内容。
有知道怎么做的吗?
使用普通的 AppleScript 除了使用 UI Scripting 之外,没有其他编程方式。请注意,这还需要提供例如脚本编辑器,或者 运行 AppleScript code, accessibility privileges 这样才能正常工作。
你需要通过name
或id
告诉Notes到show
note
然后使用系统事件 单击 浮动选定的注释 菜单项 Window 菜单 of Notes.
tell application "Notes"
show note "Foobar"
activate
end tell
delay 0.5
tell application "System Events" to ¬
tell application process "Notes" to ¬
click menu item "Float Selected Note" of ¬
menu 1 of ¬
menu bar item "Window" of ¬
menu bar 1
注意:将Foobar
改为note
的name
你想在单独的window中打开或者使用其 id
,例如:
note id "x-coredata://C48EA527-911C-49D0-950F-A15229B7D58F/ICNote/p55"
您还可以通过 number 告诉 Notes 到 show
a note
并且还包括 [= account
的 15=] 以及 folder
的 name
(如果适用),例如:
tell application "Notes"
tell account "Name"
tell folder "Name"
show note 1
end tell
end tell
end tell
注意:将Name
替换为对象的实际名称。根据需要更改 note
的 number。
然后使用系统事件 命令点击目标菜单项.
注意:示例 AppleScript code 就是这样,不包含任何可能适当的错误处理。用户有责任根据需要添加任何 错误处理 。看看 try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.