Guest
2010-03-27, 01:11 AM
A script, which you could add to the Finder script menu, and perhaps assign a keystroke to, might contain code roughly along these lines:
Code:
-- Closes OmniOutliner before Restarting OS X
-- Modified OmniOutliner documents are saved before they are closed.
-- OO documents with names like Untitled, or Untitled 2
-- are saved with filenames built from the current system date
property pAppToClose : "OOut"
property pUnSavedName : "Untitled"
on run
if AppIsRunning(pAppToClose) then
tell application id "com.omnigroup.OmniOutlinerPro3"
set lstDoc to documents
repeat with oDoc in lstDoc
tell oDoc
if modified then
if name of oDoc contains pUnSavedName then
set name of oDoc to ((current date) as string) & ".oo3"
end if
save
end if
close
end tell
end repeat
quit
end tell
end if
tell application id "com.apple.finder"
restart
end tell
end run
on AppIsRunning(strAppCode)
tell application id "com.apple.systemevents"
(creator type of processes) contains strAppCode
end tell
end AppIsRunning
Last edited by RobTrew; 2010-03-29 at 10:38 PM..
Reason: added .oo3 extension to date-based file name