• 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: Get list of desktops?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get list of desktops?


  • Subject: Re: Get list of desktops?
  • From: "koenig.yvan" <email@hidden>
  • Date: Thu, 18 Jul 2013 17:21:13 +0200


Le 18/07/2013 à 16:20, Alex Zavatone <email@hidden> a écrit :

It appears I'm looking at this problem wrong, but…

I'm trying to cook up a simple little AS app that I might be able to make into a right click service on the desktop to that I can have the desktop randomly pick another photo from the desktops folder.  

The issue is that I often have more than one desktop and though we can do this:

tell application "System Events"
tell current desktop
-- stuff
end tell
end tell

I was expecting that somewhere there was a list of all desktops such as "desktops" or "the desktops" or "desktops list" or "list of desktops".

Somehow, I thought this would be tracked and exposed, but I can't find it.

What does work though is "set x to every desktop" but this doesn't work if I try to message the desktop by that ID like so:

repeat with myDesktopID in myDesktops
tell myDesktopID
set initInterval to get change interval -- get the current display interval
This is what ends up happening:

tell application "System Events"
get every desktop
--> {desktop "69677952", desktop "69503829"}
get change interval of desktop "69677952"
--> error number -10002 from «class dskp» "69677952"
error "System Events got an error: Invalid key form." number -10002 from desktop "69677952"

What's the proper method to getting the list of desktops and walking it?

TY.



tell application "System Events"
set nbDesktops to count desktop
repeat with i from 1 to nbDesktops
properties of desktop i
end repeat
end tell

may do the trick


 _______________________________________________
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

  • Follow-Ups:
    • Re: Get list of desktops?
      • From: Alex Zavatone <email@hidden>
References: 
 >Get list of desktops? (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Get list of desktops?
  • Next by Date: Re: Get list of desktops?
  • Previous by thread: Get list of desktops?
  • Next by thread: Re: Get list of desktops?
  • Index(es):
    • Date
    • Thread