정확히 어떻게했는지 기억이 나지 않지만 여러 AppleScript 덕분에 일부 소스 코드 덕분에 AppleScript를 실행 한 버틀러와 매핑 된 키보드 단축키를 사용했습니다.Finder 윈도우 목록 저장 및 복원
하나의 스크립트는 모든 Finder 윈도우 속성을 텍스트 파일 (이름에 대한 프롬프트)에 저장하고 다른 하나는 파일 (이름에 대한 프롬프트)을 읽고 그에 따라 Finder 윈도우를 복원하는 데 사용되었습니다. 그렇게 보일 것이다
텍스트 파일 : 거기에서
{
{
folder "Desktop"
of folder "Me"
of folder "Users"
of startup disk of application "Finder", {
0, 0, 1200, 315
}, column view, 192
}, {
folder "Backups"
of disk "SAFE"
of application "Finder", {
0, 380, 1200, 685
}, column view, 192
}
}
, 나는 창문을 복원하는 방법을 알고있다. 난 그냥
이 창을 복원하려면 ... 그 모든 값을 검색, 내가 만든 스크립트를 분실 :
tell application "Finder"
set windowList to {
{
folder "Desktop"
of folder "Me"
of folder "Users"
of startup disk of application "Finder", {
0, 0, 1200, 315
}, column view, 192
}, {
folder "Backups"
of disk "SAFE"
of application "Finder", {
0, 380, 1200, 685
}, column view, 192
}
}
close every window
repeat with i from 1 to count of windowList
set theseProps to item i of windowList
make new Finder window at front to item 1 of theseProps
tell window 1
set bounds to item 2 of theseProps
set current view to item 3 of theseProps
set sidebar width to item 4 of theseProps
end tell
end repeat
end tell
내 질문 : 어떻게 AppleScript로 모든 Finder 윈도우와 속성을 얻는 방법? 파일에 저장하는 방법은 무엇입니까?
[편집] 여기
어떻게 모든 속성이 필요 얻을 수 있습니다 :
set windowsList to {}
tell application "Finder"
set theWindows to windows
repeat with theWindow in theWindows
set t to target of theWindow
set b to bounds of theWindow
set v to current view of theWindow
set w to sidebar width of theWindow
copy {t, b, v, w} to end of windowsList
end repeat
end tell
지금 나중에 목록으로로드 할 수있는, 파일이 저장 방법이 필요합니다 에 ...
[편집] I 파일이 w에 쓸 수 있어요
ay :
set prefs_folder to path to preferences folder as string
set prefs_file to prefs_folder & "finderwindows"
try
set open_file to ¬
open for access file prefs_file with write permission
-- erase current contents of file:
set eof of open_file to 0
write windowList to open_file starting at eof
close access open_file
on error
try
close access file prefs_file
end try
end try
그러나 파일은 비어 있습니다. 이 스크립트는
내 질문은 지금 ... 오류 -10004 함께 종료된다
는 어떻게 다음 다른 스크립트에서 읽고 검색 할 수있는 파일 저장 가능한 형식으로 windowList를 변환 ??