zaf*_*zaf 7 windows macos desktop state
我正在寻找方法来减少浪费时间来打开所需的所有应用程序,定位窗口,打开网址/文件/更改目录等.在实际编码开始之前.
在完美的世界中,每个'项目'将有2个按钮标记为'SAVE STATE'和'RESTORE STATE'.您在某些游戏中找到的功能.
我在Mac上花了几个小时用'Automator'敲打我的头(由于某种原因甚至有问题甚至从码头打开火狐)然后是AppleScript(这让我感觉我很长时间骑了).
在网上搜索引导我到这个脚本:
http://snipt.net/Fotinakis/applescript-to-save-and-restore-window-positions/
#!/usr/bin/osascript
-- Usage:
-- $ osacompile -o windowPositions.compiled.scpt windowPositions.scpt
-- $ osascript windowPositions.compiled.scpt --save
-- $ osascript windowPositions.compiled.scpt --restore
-- Change this to be the list of windows you want to save/restore
property affectedProcesses : {"Chrome", "Adium", "Eclipse", "Terminal"}
property windowRecord : {}
on run argv
if (count of argv) is equal to 0 then
log "Please specify one of --save or --restore."
return
end if
tell application "System Events"
if (item 1 of argv is equal to "--save") then
set windowRecord to {}
repeat with i from 1 to count affectedProcesses
set end of windowRecord to {0, {}, {}}
end repeat
repeat with p from 1 to count affectedProcesses
set processName to (item p of affectedProcesses)
if exists process processName then
log "Process '" & processName & "' exists"
tell process processName
set numWindows to count windows
set item 1 of item p of windowRecord to numWindows
repeat with i from 1 to numWindows
set end of item 2 of item p of windowRecord to position of window i
set end of item 3 of item p of windowRecord to size of window i
end repeat
end tell
end if
end repeat
else
repeat with p from 1 to count affectedProcesses
set processName to (item p of affectedProcesses)
if exists process processName then
log "Process '" & processName & "' exists"
tell process processName
set numWindows to item 1 of item p of windowRecord
repeat with i from 1 to numWindows
set position of window i to (item i of item 2 of item p of windowRecord)
set size of window i to (item i of item 3 of item p of windowRecord)
end repeat
end tell
end if
end repeat
end if
end tell
end run
Run Code Online (Sandbox Code Playgroud)
它完成了一半的工作(调整大小和位置当前窗口),但在多显示器多桌面设置上分崩离析.原始作者没有联系信息可以寻求帮助或反馈.
任何人都可以了解如何保存和恢复应用程序和布局?感觉就像这样一个常见的任务,应该有一些帮助工具.我所拥有的最好的是"睡眠模式",但似乎我必须每隔一天进行一次完全重启,并且我有不同的应用程序和布局用于不同的项目.
| 归档时间: |
|
| 查看次数: |
1321 次 |
| 最近记录: |