Re: path to frontmost application as text but another way...
Re: path to frontmost application as text but another way...
- Subject: Re: path to frontmost application as text but another way...
- From: Paul Skinner <email@hidden>
- Date: Wed, 24 Jul 2002 00:06:18 -0400
On Tuesday, July 23, 2002, at 10:15 PM, Paul Berkowitz wrote:
On 7/23/02 6:45 PM, "Zimba" <email@hidden> wrote:
The question is kinda all included in the Subject: is there a way to
get the path path to frontmost application as text without using the
Standard Additions...
Thanks in advance...
Why would you want another way?
You aren't trying to think different are you? : )
Standard Additions is built into every OS
and that _always_ works. You should be able to use the Finder, but it's
more
roundabout and doesn't work in OS 10.0.x (not that anyone is using
10.0.x
any more).
tell application "Finder"
set frontApp to item 1 of (every process whose frontmost is true)
set pathToFrontApp to application file of frontApp as alias as
string
end tell
-->Finder got an error: NSReceiverEvaluationScriptError: 3
ie. I can't get item 1.
OS 10.1.5/AS 1.8.3 SD 3.0.3
And it also doesn't seem to be working in OS 10.1.5/AS 1.8.3! 'every
process
whose frontmost is true' just keeps hanging. In Script Editor you can't
even
stop the script, and have to force-quit. In script Debugger you can
stop it.
Apparently it doesn't form that single item list properly. If you coerce
the result to list then evaluate it you'll get the right answer.
tell application "Finder"
(application file of (item 1 of ((every process whose frontmost is
true) as list)) as alias) as string
end tell
-->"darkstar:Applications:AppleScript:Script Debugger 3.0:Script
Debugger"
Or don't worry about it.
tell application "Finder"
application file of (every process whose frontmost is true) as string
end tell
-->"darkstar:Applications:AppleScript:Script Debugger 3.0:Script
Debugger"
Confirmation?
Anyway, use path to frontmost application. there isn't anyone in the
world
who doesn't have Standard Additions.
--
Paul Berkowitz
--
Paul Skinner
_______________________________________________
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.