Relaunch uses Applescript to find out about which documents your applications have open and also to tell them to launch the documents when it needs to.
You can see the scripts by option-clicking on the Relaunch application item and selecting 'Show Package Contents' then navigating into the Resources folder.
In there are numerous AppleScripts, one for each application that Relaunch needs to know about. Non-document based applications, such as AddressBook don't need a script, Relaunches default behaviour is just to start an application.
The scripts are grouped into two kinds Ask{application name} and Tell{application name}
The Ask scripts simply need to return a list containing the path of each document you want to reopen e.g. for Text Edit: -
--AskTextEdit.scpt tell application "TextEdit" set file_list to path of every document end tellAnd the Tell scripts need to be able to open a single application based on one of the paths saved from the ask script, again for TextEdit
--TellTextEdit.scpt on open_document(document_name) tell application "TextEdit" activate open document_name end tell end open_document
That's really all there is to it. If you do add support for any applications, it would be great for me and the other users of the application if you could forward your finished scripts to [email protected] and I'll include them in a future version of the product.