I have a dumb AppleScript question (Applescript n00b here). Trying to modify Doug Adams' "Show Description" script http://dougscripts.com/416 to save the iTunes long description for an item to a text file instead of displaying it in a dialog.
This works, but TextEdit prompts for confirmation at the close. I think it is because of the formatting info that may be lost when it was saved as text. Is there any way for me to avoid the confirmation dialog?
B
This works, but TextEdit prompts for confirmation at the close. I think it is because of the formatting info that may be lost when it was saved as text. Is there any way for me to avoid the confirmation dialog?
Code:
tell application "iTunes"
activate
if selection is not {} then
set sel to item 1 of selection
my save_info(sel)
end if
end tell
to save_info(sel)
with timeout of 3000 seconds
tell application "iTunes"
tell sel
set {desc, loc} to {long description, location}
if desc is missing value then set desc to ""
set ploc to the POSIX path of loc
set ldpath to ploc & ".txt"
(* display dialog ldpath *)
tell application "TextEdit"
activate
make new document at the front
set the name of the front document to ldpath
set the text of the front document to desc as text
save the front document in ldpath
close the front document
end tell
end tell
end tell
end timeout
end save_info
B