• 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: keystroke command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keystroke command


  • Subject: Re: keystroke command
  • From: kai <email@hidden>
  • Date: Mon, 29 May 2006 19:57:36 +0100


On 29 May 2006, at 19:18, Michelle Steiner wrote:


On May 29, 2006, at 10:40 AM, Robert Poland wrote:

I have implemented Michelle's suggestion,

For me, your suggestion selects all of the DESKTOP items, even if I do as follows;

activate application "Finder"
tell application "System Events"
	tell process "Finder" to tell window 1
		keystroke "a" using {command down} -- select all
	end tell
end tell

It will select all in the front window; if there isn't an open window, it will select all the desktop items.

It will also select all desktop items if a Finder window is open but isn't frontmost (if you open a Finder window, then click on the desktop, for example). So, as well as bringing the app to the front, it's also worth making sure the Finder window is raised to accept the keystroke command:


----------------

tell application "System Events" to tell process "Finder"
	set frontmost to true
	tell window 1 to if exists then
		perform action "AXRaise"
		keystroke "a" using {command down}
	end if
end tell

----------------

As Bill says, though, Michelle's original suggested selection method is preferable.

That said, Bob mentioned that his ultimate goal was to "set index labels". If you could let us know specifically what you mean by that, Bob, I have a feeling there might be a way to achieve it without having to select any items at all.

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: keystroke command (From: Bill Cheeseman <email@hidden>)
 >Re: keystroke command (From: Robert Poland <email@hidden>)
 >Re: keystroke command (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: keystroke command
  • Next by Date: Re: keystroke command
  • Previous by thread: Re: keystroke command
  • Next by thread: Re: keystroke command
  • Index(es):
    • Date
    • Thread