有没有办法根据位置自动按顺序命名 Omnigraffle 中的画布?有 AppleScript 或插件吗?
例如想法 1、想法 2、想法 3 等等。如果我移动它,它将使用新位置作为名称的一部分,并更新其他内容以保持连续性(画布编号调整)。
答案1
好的,在浏览了这些网站后,我使用 Applescript 来执行此操作:
- http://www.j-schell.de/node/153
- http://mac.tutsplus.com/tutorials/automation/if-and-if-else-applescript-conditional-statements/
- http://forums.omnigroup.com/showthread.php?t=22828
- http://mac-os-x.10953.n7.nabble.com/AppleScript-loop-works-only-the-first-time-td34104.html
- http://macscripter.net/viewtopic.php?id=17447
- http://forums.omnigroup.com/showthread.php?t=24079
tell application "OmniGraffle Professional 5"
activate
set theDocument to front document
set theCanvases to every canvas of theDocument
set canvasCount to count of canvases of theDocument
repeat with canvasNumber from 1 to canvasCount
set canvasNumber to canvasNumber as number
if canvasNumber < 10 then
set dd to "0" & canvasNumber
else
set dd to canvasNumber
end if
set name of canvas canvasNumber of theDocument to "Mockup " & dd
set canvas of front window to canvas canvasNumber of theDocument
end repeat
end tell