Quote:
Originally Posted by anika123
(Post 546947)
Can I get a quick pointer on how to create a plist file please. I would like to try this script.
|
Sure.
1). Open "/Developer/Applications/Utilities/Property List Editor"
2). In the window that comes up, click on the "Root" element and then hit the "Add Child" button 5 times, to add 5 items.
3). Now, go through and rename all of the items from "New item..." to one of the item names needed. These are: scriptFile, sourceDir, fileLimit, fileExtension, and dirPrefix.
4). Next, change the Type for fileLimit to Number (the rest stay as String).
5). Now, assign the values you want to use. In my case, I am using the following:
scriptFile - movetracks.sh
sourceDir - songs
fileLimit - 100
fileExtension - .mp3
dirPrefix - music_
6). Finally, save the file in ~/Library/Preferences/trackmover.plist
That's it.
If you do not happen to have the Developer tools installed, you will need to manually create a file, using any text editor, that looks something like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileLimit</key>
<integer>100</integer>
<key>scriptFile</key>
<string>movetracks.sh</string>
<key>dirPrefix</key>
<string>music_</string>
<key>fileExtension</key>
<string>.mp3</string>
<key>sourceDir</key>
<string>songs</string>
</dict>
</plist>
A plist that has the values I am using requires your source directory (the one with all the tracks) to be named "songs" and will generate a directory structure that looks like "music_001 music_002 music_003....music_010" (assuming 1000 songs as input).
Also, regrarding point "d" in my previous post. You do NOT need to have the program in the same directory as the source directory, you only need to be in that directory when you run the program from the command line. Alternatively, you could specify a full path in the plist file, then you could be anywhere. If you specify a full path for the output directory prefix, then it would be even more flexible.
FWIW, I installed this program in /usr/bin/local/trackmover.pl and made a link (ln -s) to /usr/bin/local/trackmover - so now I can run execute it by running "trackmover" from the command prompt, from anywhere.