I am finally getting back to revisiting Photoshop Scripting. I beta tested with Photoshop CS and wrote tons of scripts. Things have changed in CS2 but for the better
New features in CS2 scripting:
- File Includes
- Self Contained Scriptlet (New File extension)
- Script Events
It is a one liner to include files in your CS2 script.
//Global contants or variables can be defined in another file.
//This line should go before any code that will execute methods.
// @include "YourFileToInclude.jsx"
The self contained scriptlet is also a one liner.
// This enables double clicking on the Mac OS or on Windows
// This line of code should be first if you want your script
// to be a self contained scriptlet
The Scripting Events feature is not so much about coding but more about executing scripts when a given event happens within Photoshop CS2. Let’s say I always want a specific size of document, specific font selection, specific ruler units, and specific font color selected whenever I create a new document. I can write a script that will execute on CS2′s New Document Event. (That is another how to).
I wanted to have a common iTunes library between user accounts on the same machine to make life a little easier (my iLife that is). This feat is very easily accomplished by changing the iTunes Music folder location for all User Accounts to point at the same directory. The directory can be anywhere that a folder can be placed. I have a self-powered external Lacie firewire drive where all my machines music is stored.
Setting up the Master folder:
- Decide where you want to have your music stored. You can either create a new folder, or you can also use an existing folder, in which case you don’t do anything for this step.
- From the iTunes Application menu select preferences, select the Advanced Setting screen by clicking on the gear icon at the far right.
- The iTunes Music folder location path can now be viewed. It can be changed by clicking the Change… button and navigating to your folder of choice.
- Repeat the above steps for all User Accounts.
Setting Folder Permissions:
- From the Finder, select your new iTunes Music folder and choose Get Info (Command > i ) from the File menu.
- From the Info window, click the delta next to the Ownership & Permissions category. Then click the delta next to Details.
- You will have to be the owner of this folder or have Admin privileges to make changes.
- Click the padlock icon to unlock the detail menus.
- Change the Group menu to guest.
- Change the Access and Others menus to Read & Write.
- Click the padlock icon to lock the details menus and close the info window.
- The iTunes Music folder can now be accessed and written to by all User Accounts on your macintosh.
Users now only have to update their own iTunes library when they know another User has added songs to the Master library.
Do the following:
- From the iTunes File menu, select Add to Library… (Command > o), and navigate to the Master iTunes folder. Then click the Choose button to update your library.
- Your iTunes library will be updated with any new songs within your master folder. This includes any music located in directories within the master folder. iTunes will not add songs that have already been added in the past.
Why is this a good solution?
Apple gives us the ability to share our music with Rendezvous but other User Accounts can view the music only if the other User Accounts are logged on at the same time. The users that are logged on also have to be running iTunes. The Music sharing Apple provides is also read only to the other accounts that you are allowing to share your music.
The solution above takes care of all these shortcomings.