Re: so what's going on here?
Re: so what's going on here?
- Subject: Re: so what's going on here?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 19 Feb 2007 19:35:15 -0800
- Thread-topic: so what's going on here?
On 2/19/07 7:15 PM, "deivy petrescu" <email@hidden> wrote:
> I've probably played with that a while ago. So I do not really
> remember how did I came up with the code.
You were told by Chris Nebel, back in OS 10,2 or 10.3 or earlier days.
> But this is what I have in 10.4.8 running AS 1.10.7:
> <script>
> set X to path to «constant afdregfp» as string
> display dialog (X) giving up after 2
> </script>
>
> In ScriptMenu it always return the frontmost app.
> Note that there is no tell block.
If your code may need to run on pre-OS 10.4 machines, then you should use
that.
If it only needs to run on your own machine, in 10.4, 'frontmost
application' works to do exactly the same thing, as I said it did. If you're
sceptical, why don't you try it? Pre-OS 10.4, it would return System Events
when running in the script menu, as 'frontmost application' still does when
called from System Events itself or the Finder, and as 'path to current
application' does. Basically, all of these used 'frontmost application' as a
synonym for 'current application', and System Events definitely is the
current application, running the script menu.
But 'path to frontmost application' was changed in 10.4 to return the
actual visible application in the _front_, as Bill expects. I would agree
with him that not returning the same (as a list) from 'every process whose
frontmost is true' in System Events should be considered a bug. But at least
'path to frontmost application' does the right thing now.
What's the point in Apple making improvements (and this one was definitely
in response to scripter requests) if you don't take advantage of them when
they occur?
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden