Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to cycle between sets of Desktop items' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to cycle between sets of Desktop items
Authored by: designr on Jul 13, '06 09:52:12AM

Just a thought... Instead of moving data around, couldn't you make 3 or 4 "Desktop" folders (i.e., Desktop 1, Desktop 2, etc.) and use the ln command to change which folder a "Desktop" alias points to?

ln [-fhinsv] source_file [target_file]

I used a similar strategy in an Applescript to switch between iTunes folders (a big 20 GB music library on my server and a small 4 GB music library on my laptop). I renamed my existing Music Folders to Local Music and Server Music and then created a symbolic link called "Music" which pointed to one or the other. The Applescript then toggled the symbolic link.

Because no data is actually moved, there is almost no time involved in switching and less risk.



[ Reply to This | # ]
A script to cycle between sets of Desktop items
Authored by: whenders0n on Jul 13, '06 11:17:04AM

heh sorry to dupe you below. you replied before i reloaded =)



[ Reply to This | # ]
Help?
Authored by: gregpare on Jul 13, '06 12:23:56PM

Anybody want to share more detailed examples on how to do this?

And, does anybody know if it is possible to change the desktop image in a script as well? I've been changing my desktops using deviant for a while, but it gets a little confusing knowing which desktop I'm using at a glance.



[ Reply to This | # ]
A script to cycle between sets of Desktop items
Authored by: designr on Jul 14, '06 08:36:19AM
Here's the script I used:

tell application "System Events"
  if not (exists application process "iTunes") then
    set short_name to do shell script ("id -un")
    tell application "Finder"
      if (exists folder "Music:ServerMusic:") then
        set the_path to POSIX path of file "Music:ServerMusic:"
        do shell script "ln -fhs '" & the_path & "' '/Users/" & short_name & "/Music'"
      else
        do shell script "ln -fhs '/Users/Shared/LocalMusic/' '/Users/" & short_name & "/Music'"
      end if
    end tell
  end if
end tell
tell application "iTunes" to activate
The two folders were "ServerMusic" on a server share called "Music" and "LocalMusic" in the /Users/Shared/ folder.

[ Reply to This | # ]