Page 1 of 1

AppleScript action delay with each use

Posted: Wed Aug 31, 2016 8:17 pm
by dfarfan
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
   else
      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?

Re: AppleScript action delay with each use

Posted: Mon Aug 14, 2017 10:16 pm
by thiprigecr
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 :-(