|Actions||previous | next|
To pass parameters to your AppleScript simply implement a handler named handle_string(). You can then pass arbitrary strings to this script via LaunchBar by selecting the script and pressing the space bar or by selecting the script as the target of a Send to… operation.
on handle_string(theString) say theString end handle_string
You can pass file paths or URLs to AppleScripts either via drag and drop or via LaunchBar’s “Send to…” functionality. Files will be passed to the script’s open() handler, URLs will be passed to the handle_string() handler.
Drag and drop: Select the desired AppleScript in LaunchBar and drag items e.g. from Finder onto that script. Choose “Send to…” from the pop-up menu or hold down the Command key during the drag to pass the dragged items immediately.
Send to: Select a file or URL in LaunchBar, then press the Tab key to trigger the “Send to…” action. Now select the desired AppleScript and press Return.
By default, LaunchBar runs AppleScripts in foreground, i.e. you cannot perform any further action in LaunchBar until the script has finished executing.
You can optionally run specific scripts in background by opening them with Option-Return.