I have been going through the book AppleScript 1-2-3 book by Sal Soghoain and Bill Cheeseman and in Lesson 5 it talks about special folder codes (i.e. pdoc for pictures folder of current user, mdoc for movies folder of current user etc.)
I would like to use one of those codes to set a path that works on other computers is it possible to do something similar to this
(*
Use this code to first find out what the name of your displays are first.
tell application "System Events"
get display name of every desktop
end tell
*)
tell application "System Events"
set theDesktops to a reference to (every desktop whose display name is "Cinema HD")
set picture of item 1 of theDesktops to file "pdoc:SwitchResX:Desktop 5A"
end tell
tell application "System Events"
set theDesktops to a reference to (every desktop whose display name is "Cinema HD")
set picture of item 2 of theDesktops to file "Home Folder:Pictures:SwitchResX:Desktop 5B.jpg"
end tell
I will have a folder named “SwitchResX” and a picture named “Desktop 5A” (or “Desktop 5B”).
From what I found in another thread the following looks like the way to do it. It is hard for me to follow and I am not sure how to implement it. I am hoping to find something easier to remember, but I am guessing there might not be a way since I might have to define if it is System domain, Local domain, User domain or Network domain.
set pic_folder to (path to "pdoc" from user domain) as string
set new_folder to (pic_folder & "new") as file specification
It would be nice if something like this even worked
tell application "System Events"
set theDesktops to a reference to (every desktop whose display name is "Cinema HD")
set picture of item 2 of theDesktops to file "Desktop 5B.jpg" of folder "SwitchResX" of pdoc from user domain
end tell
I hope that wasn’t too confusing.