Help Please! I need Applescript help!

Joined
Nov 25, 2011
Messages
1
Reaction score
0
Points
1
Hi everyone, I'm a new poster to the forum but have always searched through your vast knowledge for other issues :)

I have an unusual setup at home, we have a XServe running 10.5.8 that has hard drive specifically for storing movies and TV shows. With the addition of an AppleTV to our living room, we decided that we would like all of the movies and TV shows added to iTunes. After a ton of converting and adding meta data, I finally have all the files we currently have in iTunes. The problem is, tomorrow when I rip yet another princess DVD for our daughter and add it to the movies folder, how do I get it to be added to iTunes automatically so she can access it through the AppleTV?

I found on DougScripts page the simple applescript for adding to iTunes, but it isn't working for me. I think because of the way we have our folder structure:

Movies
>Action
>>Title 1
>>Title 2
>Family
>>Title 1
>>Title 2
ect....

The script is:
on adding folder items to my_folder after receiving the_files
repeat with i from 1 to number of items in the_files
tell application "iTunes"
launch
try
set this_file to (item i of the_files)

add this_file

end try
end tell
end repeat
end adding folder items to

Please Help! I have worked on it and searched for hours and am at my wits end. :(
 
Joined
Aug 13, 2011
Messages
200
Reaction score
7
Points
18
Location
West Sussex
That can't be the whole Applescript that you have posted.
It looks like just a single Applescript method that you have there, and it has no way of
knowing what folder the my_folder variable needs, or the files the the_files variable also needs.

Post the whole script if you need help with it, or a link to the downloaded Applescript so
someone can go through the linked script.

Regards Mark
 
Joined
Aug 2, 2011
Messages
16
Reaction score
0
Points
1
This IS a complete applescript. The structure — "on adding folder items..." — indicates it is set up to be run as a folder action. The script needs to be attached to a folder — when items are dropped in the folder, the script will add them to iTunes.

But, jf4m, that's the extent of the script — it just adds the items to iTunes. This script in its current form has no way of knowing which part of the hierarchy you are trying to add an item to. So, basically, it does exactly the same as drag-dropping the files straight onto the iTunes icon in your dock (except it won't automatically start playing them).

I expect the script was originally written to work with a download folder (ie. items are added to iTunes at download — without the need to drag-drop)

Hope that helps a little.

m.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top