Re: Determining frontmost application in OS X
Re: Determining frontmost application in OS X
- Subject: Re: Determining frontmost application in OS X
- From: bryan <email@hidden>
- Date: Fri, 19 Jul 2002 14:16:08 -0400
tell application "Finder"
select items of folder "Incoming Images:Study Server:"
end tell
-->Finder got an error: Can't get every item of folder "Incoming Images:Study Server:".
I'M STUMPED
Bryan Kaufman
Paul Berkowitz wrote:
>
It works here fine.
>
>
What happens if you use the Finder's own terms?
>
>
tell application "Finder"
>
select items of folder "Incoming Images:Study Server:"
>
end tell
>
>
(I'm just wondering if perhaps the folder "Study Server" is not on a hard
>
disk "Incoming Images" but is on your user desktop, Or maybe it's not even a
>
folder? is that really the correct path?)
>
>
--
>
Paul Berkowitz
>
>
> From: bryan <email@hidden>
>
> Reply-To: email@hidden
>
> Date: Thu, 18 Jul 2002 20:55:06 -0400
>
> To: Applescript-Users <email@hidden>
>
> Subject: Re: Determining frontmost application in OS X
>
>
>
> Ok, so it must be my system, but it's broken and I can't seem to figure out
>
> why.
>
>
>
> the script :
>
> tell application "Finder"
>
> select items of alias "Incoming Images:Study Server:"
>
> end tell
>
>
>
> returns the error :
>
> --> Finder got an error: Can't get every item of alias "Incoming Images:Study
>
> Server:".
>
>
>
> But it was working fine until a few days ago.
>
> I don't even know where to begin looking for the problem, at this point
>
>
>
> Bryan Kaufman
>
>
>
> Paul Berkowitz wrote:
>
>
>
>> Where do you hat, Bryan? Of course "items of" is working! Chris was just
>
>> saying that the ordering of the list of processes is ("currently" -?) in
>
>> launch order, not UI layer order.
>
>>
>
>> --
>
>> Paul Berkowitz
>
>>
>
>>> From: bryan <email@hidden>
>
>>> Reply-To: email@hidden
>
>>> Date: Thu, 18 Jul 2002 18:23:06 -0400
>
>>> To: email@hidden
>
>>> Subject: Re: Determining frontmost application in OS X
>
>>>
>
>>> So, now "...whose..." is working but "items of..." isn't?
>
>>> When did that happen? I made the 'mistake' of upgrading from
>
>>> 10.1.2b3 to 10.1.5 and broke my scripts.
>
>>> I tried going back to 10.1.2b3 with no luck.
>
>>>
>
>>> Anybody have any ideas?
>
>>>
>
>>> Bryan Kaufman
>
>>>
>
>>> Christopher Nebel wrote:
>
>>>
>
>>>> On Thursday, July 18, 2002, at 05:32 AM, email@hidden
>
>>>> wrote:
>
>>>>
>
>>>>> The question is, how to figure out which application is the frontmost
>
>>>>> one. Telling the Finder to get the processes gives me a list, but the
>
>>>>> first item in the list is always "loginwindow."
>
>>>>>
>
>>>>> tell application "Finder"
>
>>>>> get the name of every process
>
>>>>> end tell
>
>>>>>
>
>>>>> (result below)
>
>>>>> {"loginwindow", "Finder", "AEServer", "Dock", "SystemUIServer",
>
>>>>> "PhotoStickies", "MooSB", "Show Desktop", "Key Xing Listener", "Palm
>
>>>>> Desktop Background", "Transport Monitor", "MoonMenuXBackgrounder", "ASM
>
>>>>> Controller", "System Events", "Mail", "SecurityAgent", "Internet
>
>>>>> Explorer", "System Preferences", "Script Editor"}
>
>>>>>
>
>>>>> Can I get this list sorted "front to back?"
>
>>>>
>
>>>> If you want the last item of the list, you could say "last item of
>
>>>> the_list" or "item -1 of the_list" (negative indicies go from the end).
>
>>>> The problem is, that won't tell you the frontmost one, because that's
>
>>>> not how the list is ordered. It's actually not specified what order the
>
>>>> processes are in, but it happens (currently) to be in launch order, so
>
>>>> the last one is the most recently launched.
>
>>>>
>
>>>> Fortunately, processes have a "frontmost" property. If you substitute
>
>>>> "get the name of processes whose frontmost is true", you should get a
>
>>>> list of one string, e.g. {"Mail"}.
>
>>>>
>
>>>> --Chris Nebel
>
>>>> AppleScript Engineering
>
>>>> _______________________________________________
>
>>>> 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.
>
>>>
>
>>> [demime 0.98b removed an attachment of type text/x-vcard which had a name of
>
>>> bryan.vcf]
>
>>> _______________________________________________
>
>>> 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.
>
>> _______________________________________________
>
>> 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.
>
>
>
> [demime 0.98b removed an attachment of type text/x-vcard which had a name of
>
> bryan.vcf]
>
> _______________________________________________
>
> 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.
>
_______________________________________________
>
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.
[demime 0.98b removed an attachment of type text/x-vcard which had a name of bryan.vcf]
_______________________________________________
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.