Re: Why is all not all?
Re: Why is all not all?
- Subject: Re: Why is all not all?
- From: Robert Poland <email@hidden>
- Date: Sun, 03 Apr 2011 09:45:49 -0600
On Apr 3, 2011, at 9:15 AM, Nigel Garvey wrote:
> Robert Poland wrote on Sun, 03 Apr 2011 07:11:19 -0600:
>
>> On Apr 3, 2011, at 12:02 AM, Michelle Steiner wrote:
>>
>>> On Apr 2, 2011, at 8:42 PM, Robert Poland wrote:
>>>
>>>> List view. Some folders open and showing files.
>>>>
>>>> When I run a script with the following in it the "select All" selects
>> only folders and not the other items showing. If I do a "Select All" from
>> the finder Edit drop down menu, all items are selected.
>>>>
>>>> tell application "Finder"
>>>> if ((current view of window index 1) = list view) then
>>>> set {newL, newT, newR, newB} to bounds of window of desktop -- get
>> screen size for monitor
>>>> set wdw to Finder window 1
>>>>
>>>> tell application "System Events"
>>>> select every item in wdw -- select all
>>>> end tell
>>>
>>> Because they're not in that folder; they're in sub folders.
>>
>> What folder, the command is referring go the window.
>
> Hi, Robert.
>
> 1. Finder windows don't have elements. Any items you get from them
> belong to their targets.
>
> 2. System Events shouldn't be asked to handle Finder references.
>
> Assuming the Finder's front window is a 'Finder window', you can select
> everything in it like this:
>
> tell application "System Events"
> set frontmost of application process "Finder" to true
> keystroke "a" using command down
> end tell
> -- Delay here?
> tell application "Finder" to get selection
>
>
> NG
NG,
Using Finder instead of System Events gives the same results.
The shortcut that calls this action is control-option-command-M.
Previously I used "keystroke "a" using command down" but found that was interfered with by the option-control keys.
The cure, for now, is a delay to allow the shortcut keys to be released.
Of course that screws up a fast command.
Robert Poland - Fort Collins, CO
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden