Saving Scripts as Applications

How do you save a script as an application to put in the dock. Sometimes it is just easier to access there… OR can I put a copy of the DEVON scripts in the dock as they are? I have saved some as “applications” just to test and has not worked. Let me know what I might do. Thanks.

Open the script in Apple’s Script Editor, choose File > Save As… and the file format “application” (and maybe run only depending on the intended usage).

However, this won’t work for some scripts, e.g. some “triggered” scripts only contain a “on triggered” function and therefore won’t do anything if you use them as stand-alone applications.

Just let me know which script you want to run as an application and I’ll let you know if it’s possible.

Scripts I would like to save and put in the dock are:

Open Workspace

Copy selection to…

Thank you.

The second script won’t work as an application as it is sending an event to the active application (and therefore to itself it you’re running this script as an application), the first one might need an “activate” statement right after ‘tell application “DEVONthink Pro”’ but should basically work. Just try to save the following script as an application:

tell application "DEVONthink Pro"
	set yourError to false
		set WorkspacesList to (name of every child of record "_Workspaces_" of database 1)
	on error
		set yourError to true
		display dialog "Error: Make sure that the database contains a '_Workspaces_' group at the root level" buttons {"OK"} default button 1
	end try
	if yourError is false then
			choose from list WorkspacesList with prompt "Select a workspace"
			if the result is not false then
				set selectedWorkspace to item 1 of the result
				set selectedWorkspaceList to (name of every child of child selectedWorkspace of record "_Workspaces_" of database 1)
				set y to number of items in selectedWorkspaceList
				set z to 1
				repeat y times
					open window for record child (item z of selectedWorkspaceList) of child selectedWorkspace of parent "_Workspaces_" of database 1
					set z to z + 1
				end repeat
			end if
		on error the error_message number the error_number
			display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
		end try
	end if
end tell

The open workspace works very well. Thank you!