• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: so what's going on here?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: so what's going on here?


  • Subject: Re: so what's going on here?
  • From: deivy petrescu <email@hidden>
  • Date: Mon, 19 Feb 2007 22:15:53 -0500


On Feb 19, 2007, at 21:23, Bill Briggs wrote:

If that's the reason, then it seems like some kind of violation of the spirit of "frontmost". FBAs are faceless for a reason. They shouldn't be frontmost precisely because they are not visible.

And it gets more strange. If you exclude System Events specifically by filtering to get application processes whose background only is false (and System Events has a background only that is true), then Script Editor pops up as the frontmost application, no matter what application is frontmost.

I just extracted the bit of code that found the frontmost application and got it displayed in a dialog, and when I do that it's Script Editor that shows as the frontmost when you have purposely excluded System Events. Doesn't matter whether it's Eudora, Safari, or some other application. It's coming back as Script Editor. There's something wrong here. FastScripts menu gives proper execution (it doesn't make itself the frontmost application). TypeIt4Me gets it right. But the regular scripts menu is doing something that doesn't smell right.


However, in Tiger, 'path to frontmost application' (the 'path to' scripting addition) is "smart" and ignores the script menu and System Events running it, instead returning the "otherwise" (i.e. intuitive) frontmost app, the one you want. So get that instead. Since you can use the whole file path when targeting an application, there's no need to parse it for just the name.

   set fMostAp to (path to frontmost application) as Unicode text
should do what you want.

I'll try that to see if it works, but I'm not satisfied that, given the behaviour noted, there isn't some kind of bug here. I just tried another test and every application that I had running came back with it's frontmost "true". That's not possible.


- web

Bill,
I've probably played with that a while ago. So I do not really remember how did I came up with the code.
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.

Hope this helps

Deivy _______________________________________________
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
  • Follow-Ups:
    • Re: so what's going on here?
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: so what's going on here? (From: Paul Berkowitz <email@hidden>)
 >Re: so what's going on here? (From: Bill Briggs <email@hidden>)

  • Prev by Date: Re: so what's going on here?
  • Next by Date: Re: so what's going on here?
  • Previous by thread: Re: so what's going on here?
  • Next by thread: Re: so what's going on here?
  • Index(es):
    • Date
    • Thread