I want to make a LaunchBar script that displays in a dialog the path of a file or folder that's chosen in the first pane and then "dropped" on a script. But I can't make it work.
I've got a couple of working scripts that almost do what I want:
Return contents of first pane (used with a shortcut):
tell application "LaunchBar" set x to selection as text return x end tell
Display text written in the first pane and "dropped" on the script:
on handle_string(textFromLaunchbar) tell application "LaunchBar" display in large type textFromLaunchbar end tell end handle_string
The latter uses the handle_string() handler but I can't quite make the open() handler work for files and folders:
from the LaunchBar manual:
Sending items to AppleScripts
To pass a selected file, URL or text to an AppleScript, press the Tab key to trigger the “Send to…” action, select the desired AppleScript and press Return. Files will be passed to the script’s open() handler, URLs will be passed to the handle_string() handler.