Categories: Misc / DotNet / Java / Coder / Linux / PHP Ask - La ask - La Answer

Automatic Applescript App creation? how to??

Hi,
I'm using the script from doug named "arrange by artist album" which purpose is to create a Playlist for each album of the Library...

I wan't to customize it but i don't know how...

I want this script to drop on a specified folder an applescript file for each playlist created...
these applescript file will allowed me to launch an album by clicking on them...
i will be abble to put the album artwork as the custom icon for each of these files

i wrote this but it's not working...

set target_folder to (choose folder with prompt "Where do you want to save your AppleScripts?") as string
tell application "Script Editor"
set newdoc to make new document at end with properties ?
{contents:?
("
set playList_name to artist_name & \" - \" & album_name
tell application \"iTunes\"
try
play playlist playList_name
end try
end tell
") ?
}

-- This is where i don't know how to save newdoc to the disk!!!!!!!!

end tell

i don't know how to tell script editor to save a new file with a specific content to a specific place ?

HELP PLEASE!!!!!!!!!!!!
[1234 byte] By [hangon] at [2007-11-9 13:31:39]
# 1 Re: Automatic Applescript App creation? how to??
You need to use the store script command, which is part of the standard additions.
DeltaTee at 2007-11-15 17:25:10 >
# 2 Re: Automatic Applescript App creation? how to??
You want to save the script snippet you have just created in Script Editor. You would have to use something like:

tell application "Script Editor"
set newdoc to make new document at end with properties ?
{contents:?
("
set playList_name to artist_name & \" - \" & album_name
tell application \"iTunes\"
try
play playlist playList_name
end try
end tell
") ?
}
save newdoc
end tell

Learn more about the save application command here (http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/AppleScript.74.html#40186).
Doug Adams at 2007-11-15 17:26:08 >
[an error occurred while processing this directive]
[an error occurred while processing this directive]