AppleScript action delay with each use

Sharing and discussing custom actions for LaunchBar
Posts: 7
Joined: Tue Mar 29, 2011 5:03 pm

AppleScript action delay with each use

Postby dfarfan » Wed Aug 31, 2016 8:17 pm

Hi everyone,

I have written this little AppleScript action to be used with LaunchBar. I have several Firefox profiles and I like to open them with similar scripts:

Code: Select all

on run
   set profile to "WhatsApp"
   set findpid to "ps -ef | grep " & profile & " | grep -v grep | awk '{print$2}'"
   set openprofile to "open -na Firefox --args -no-remote -P " & profile
   set pid to do shell script findpid
   if pid = "" then
      do shell script openprofile
      tell application "System Events" to set frontmost of every process whose unix id is pid to true
   end if
end run

Each time I use this action, the delay between pressing enter and the action itself increases, at the point I have to relaunch LaunchBar to "reset" the delay.

Can anyone help me with this issue? Why the increasing delay? It's LaunchBar or System Events fault? Or bad written action?

Posts: 2
Joined: Sat Apr 08, 2017 6:35 pm

Re: AppleScript action delay with each use

Postby thiprigecr » Mon Aug 14, 2017 10:16 pm

There's usually a delay when running AppleScript.
I've noticed it with many scripts I use.
That's a major turnoff of using AppleScript unfortunately :-(

Return to “LaunchBar Actions”

Who is online

Users browsing this forum: No registered users and 4 guests