Note: I have upgraded to Mavericks 9.2. This option is not offered in the drop down for Operating System.
I looked through the posts in this forum, as well as using a search engine, and cannot find specifically what I need to know.
I use multiple desktops on one monitor. I have some background (wallpapers) I have made with each one showing a number.
Ultimate Goal: To have each desktop using the image that represents that desktop’s index. As the desktops move about, thereby changing their indices, I’d want the background images to change accordingly.
Immediate Issue: I cannot get a list of the names, indices, nor the count of the desktops.
This is the most current code I have used:
tell application “System Events”
activate
get name of every desktop
set DesktopNames to name of every desktop
get count of items in DesktopNames
set DesktopCount to count of items in DesktopNames
end tell
DesktopNames & DesktopCount
The result is {“iMac”, 1}
If I change this to get the IDs instead of names I get this {69730752, 1}
Any thoughts, ideas, or suggestions would start me on my way.
Model: iMac mid-2011
AppleScript: 2.6.1
Browser: Safari 7.0.2 (9537.74.9)
Operating System: Mac OS X (10.8)
Maybe this may help :
(*
From Robert POLAND
Edited by Yvan KOENIG
*)
set switchTo_loc to localized string "Switch to Space 1" from table ¬
"DefaultShortcutsTable" in bundle file ((path to system folder as text) & "Library:PreferencePanes:Keyboard.prefPane:")
# Keeps only the string before the digit 1
set switchTo_loc to item 1 of my decoupe(switchTo_loc, "1")
tell application "System Preferences"
activate
reveal anchor "shortcutsTab" of pane id "com.apple.preference.keyboard"
end tell # application "System Preferences"
tell application "System Events"
activate
tell process "System Preferences"
tell window 1 to tell splitter group 1 of tab group 1
tell table 1 of scroll area 1
# Code identifying the entry entitled "Mission Control"
set theRow to 0
repeat with r from 1 to count rows
if name of first static text of row r is "Mission Control" then
set theRow to r
exit repeat
end if
end repeat
if theRow > 0 then
# select the correct row (2 in French, 3 in English)
select row theRow
else
error "There is no Mission Control entry !"
end if
end tell # table 1 of scroll area 1
set numSpaces to count (UI elements of rows of outline 1 of scroll area 2 whose name begins with switchTo_loc)
end tell # window 1 to tell splitter group 1 of tab group 1
end tell # process "System Preferences"
# tell application "System Preferences" to quit
end tell # System Events
#=====
on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
#=====
Yvan KOENIG (VALLAURIS, France) lundi 24 mars 2014 18:16:01