• 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: Script to Cycle Through Apps?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to Cycle Through Apps?


  • Subject: Re: Script to Cycle Through Apps?
  • From: steve harley <email@hidden>
  • Date: Wed, 20 Oct 2004 23:50:43 -0600

on 20 Oct 2004, at 11:14 PM, Michelle Steiner wrote:

On Oct 20, 2004, at 10:05 PM, steve harley wrote:

set random_app to item (random number from 1 to length of the_apps) of the_apps

This seems to work:

tell application "System Events"
	set the_apps to every application process whose visible is true
	set random_app to some item of the_apps
	set frontmost of random_app to true
end tell

yes, but Michelle also remembered the "tell application (name of process)" trick; her solution is better still

Actually, it's that I didn't think of "set frontmost of random_app to true", and I knew how to activate an application; I didn't think of it as a trick.


But why is mine better? Seems to me that either would work.

because frontmost is designated read only, so i disobeyed the dictionary by using it.. i'm also not sure frontmost and active are really the same thing (are they?)


_______________________________________________
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: 
 >Script to Cycle Through Apps? (From: Marconi <email@hidden>)
 >Re: Script to Cycle Through Apps? (From: steve harley <email@hidden>)
 >Re: Script to Cycle Through Apps? (From: David Andrews <email@hidden>)
 >Re: Script to Cycle Through Apps? (From: steve harley <email@hidden>)
 >Re: Script to Cycle Through Apps? (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Set Volume / Get Volume ?
  • Next by Date: Re: Creating a log file.
  • Previous by thread: Re: Script to Cycle Through Apps?
  • Next by thread: Creating a log file.
  • Index(es):
    • Date
    • Thread