Re: Frontmost app
Re: Frontmost app
- Subject: Re: Frontmost app
- From: Steve Roy <email@hidden>
- Date: Fri, 17 Jan 2003 09:03:53 -0500
email@hidden (Emmanuel) wrote:
>
Not any better way that I know.
Thank you everybody for your answers. I was wondering if I had missed something
obvious.
I did a test to compare the speed of the 'path to' solution with my previous
solution.
on run
set theStartTime to current date
repeat 1000 times
getFrontApplication1()
end repeat
set theEndTime to current date
set theDiff to theEndTime - theStartTime
display dialog theDiff
end run
on getFrontApplication1()
tell application "Finder"
set theList to name of every process whose frontmost is true
end tell
return application (theList as string)
end getFrontApplication1
on getFrontApplication2()
return application (path to frontmost application as string)
end getFrontApplication2
Called a thousand times, my original method took 47 seconds to complete. The
'path to' solution did the same thing in 2 seconds.
Steve
--
Steve Roy <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.