Tôi đang tìm cách giảm thời gian lãng phí để mở tất cả các ứng dụng cần thiết, cửa sổ vị trí, mở url/files/change directories/etc. trước khi bắt đầu mã hóa thực tế.Lưu và khôi phục ứng dụng và bố cục
Trong thế giới hoàn hảo, sẽ có 2 nút được đánh dấu 'TIẾT KIỆM STATE' và 'RESTORE STATE' cho mỗi 'dự án'. Loại tính năng bạn tìm thấy trong một số trò chơi.
Tôi đang sử dụng máy Mac và chỉ mất vài giờ để đập đầu bằng 'Automator' (vì một số lý do có vấn đề khi mở firefox từ dock) và sau đó là applescript (mang lại cho tôi cảm giác tôi đang ở cho một chuyến đi dài).
Tìm kiếm trên mạng dẫn tôi đến kịch bản này:
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
Nó nửa công việc (thay đổi kích thước và vị trí của cửa sổ hiện hành) nhưng sụp đổ trên một thiết lập đa màn hình multi-máy tính để bàn . Không có thông tin liên hệ nào cho tác giả gốc để yêu cầu trợ giúp hoặc phản hồi.
Có ai có thể tiết lộ một số ánh sáng về cách lưu và khôi phục ứng dụng và bố cục không? Nó cảm thấy như một nhiệm vụ phổ biến mà nên có một số tiện ích trợ giúp. Điều tốt nhất tôi có là 'chế độ ngủ' nhưng có vẻ như tôi phải khởi động lại đầy đủ mỗi ngày và tôi có các ứng dụng và bố cục khác nhau cho các dự án khác nhau.
Có thể là giá trị yêu cầu trên Super User. Có thể đã có những ứng dụng sẵn có làm điều này và một người nào đó trên SU có thể biết. – Herms
Hmmm có thể. Tôi sẽ dán câu hỏi này ở đó. Chúc mừng. – zaf