How to chain Launchbar actions

Sharing and discussing custom actions for LaunchBar
danielgm
Posts: 9
Joined: Wed Jul 09, 2014 3:35 pm

How to chain Launchbar actions

Postby danielgm » Wed Jul 09, 2014 3:44 pm

I am looking to put existing launchbar actions and custom actions in a chain that can be executed with a single trigger.

Specifically, I want to:

- quit specific programs
- turn off bluetooth
- switch network location to a specific location

How can this be done?

iRounak
Rank 4
Rank 4
Posts: 191
Joined: Fri Oct 23, 2009 7:11 pm
Contact:

Re: How to chain Launchbar actions

Postby iRounak » Wed Jul 09, 2014 5:16 pm

LB supports use of "perform action" in applescript

danielgm
Posts: 9
Joined: Wed Jul 09, 2014 3:35 pm

Re: How to chain Launchbar actions

Postby danielgm » Thu Jul 10, 2014 1:06 am

thanks, that worked for bluetooth.

Network locations are not an action in Launchbar and apparently not scriptable...

Quitting an app is an action but somehow passing an argument does not work.

Code: Select all

perform action "Quit Application" with string "Mail"


Any ideas?

iRounak
Rank 4
Rank 4
Posts: 191
Joined: Fri Oct 23, 2009 7:11 pm
Contact:

Re: How to chain Launchbar actions

Postby iRounak » Thu Jul 10, 2014 3:22 am

You can use

Code: Select all

tell application "System Events" to quit application "Mail"


For network, try:

Code: Select all

tell application "System Events"
   tell network preferences
      --set allLocations to the name of every location
      
      --set activeLocation to the name of current location
   end tell
end tell

danielgm
Posts: 9
Joined: Wed Jul 09, 2014 3:35 pm

Re: How to chain Launchbar actions

Postby danielgm » Thu Jul 10, 2014 11:01 am

Nice, quitting applications via System events works!

The network location script looks good but what is the action name to actually change locations?

I tried activate and connect but they don't work.

danielgm
Posts: 9
Joined: Wed Jul 09, 2014 3:35 pm

Re: How to chain Launchbar actions

Postby danielgm » Thu Jul 10, 2014 11:50 am

I got it to work using a shell script

Code: Select all

do shell script "scselect '" & ("Automatic") & "'"

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: How to chain Launchbar actions

Postby ptujec » Thu Jul 10, 2014 1:11 pm

danielgm wrote:Nice, quitting applications via System events works!


Code: Select all

quit application "Mail"

… works too. Less typing ;)

danielgm
Posts: 9
Joined: Wed Jul 09, 2014 3:35 pm

Re: How to chain Launchbar actions

Postby danielgm » Sun Jul 13, 2014 7:59 pm

even better, thanks!


Return to “LaunchBar Actions”

Who is online

Users browsing this forum: No registered users and 3 guests