New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Ľ Advice and insight from world-class Apple enthusiasts Ľ Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Help Please! I need Applescript help!

Post Reply New Thread Subscribe

Thread Tools

Member Since: Nov 25, 2011
Posts: 1
jf4m is on a distinguished road

jf4m is offline
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:

>>Title 1
>>Title 2
>>Title 1
>>Title 2

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"
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.
QUOTE Thanks
Mark FX

Mark FX's Avatar
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 180
Mark FX has a spectacular aura about

Mark FX is offline
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
QUOTE Thanks

MacGrunt's Avatar
Member Since: Aug 02, 2011
Posts: 16
MacGrunt is on a distinguished road

MacGrunt is offline
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.

QUOTE Thanks

Post Reply New Thread Subscribe

« Have you ever thought of getting Apple certification? | Kext causing kernel panic? Need help troubleshooting, please. »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Restarting Application using Applescript from Java? iwebdevelop OS X - Development and Darwin 7 08-10-2011 07:53 AM
Applescript help with serial port access ljimber OS X - Development and Darwin 0 06-24-2011 11:46 AM
help needed to link up buttons on HUD Window to Applescript nick_harambee OS X - Development and Darwin 0 09-30-2010 08:26 AM
newbie question on XCode 3.2: how to populate pop up buttons/link to applescript nickharambee OS X - Operating System 0 10-21-2009 07:10 AM
[ANN] New comprehensive AppleScript book hanaan OS X - Development and Darwin 0 11-06-2004 07:28 PM

All times are GMT -4. The time now is 08:38 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?