Select from list of strings with option to create new?

Sharing and discussing custom actions for LaunchBar
Post Reply
foggyburger
Posts: 3
Joined: Tue Feb 18, 2014 10:04 pm

Select from list of strings with option to create new?

Post by foggyburger » Thu Mar 31, 2016 5:55 am

I'm in the middle of creating a LaunchBar Action that can read in a list of strings but with the option of typing a new string.

Lists could be passed to the Action using applescript like so:

Code: Select all

set input to "Item 1" & return & "Item 2" & return & "Item 3"
tell application "LaunchBar"
   perform action "MyAction" with string input
end tell


'MyAction' would add the initial option "Enter New Item" and the list of items:
Image

Here's the part I can't figure out. I would like pressing "Return" on "Enter New Item" to do this:
Image

Where whatever is typed is passed on to handler in the LB Action's default script.

I'm using applescript and I can get it done with 2 separate LB Actions but I was wondering if it can be done with one. Basically call an action that requires a string argument (but isn't the default script).

Thanks!

Post Reply