Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript to trap when I insert my ipod?



Has anybody been able to get this one working?

On Oct 24, 2006, at 3:47 PM, Mr Tea wrote:

This from Steven Halford - dated 24/10/06 8.23 pm:

Previously, I have attached a folder action script to the hidden
folder /Volumes/ that runs a script along the lines of

tell application "Finder"
if exists (disk "My_iPod_Name") then
--do the iTunes stuff
end if
end tell

[snip]

The problem with this method is that the script is run whenever a
disk is mounted and the /Volumes folder is changed, which means that
if a CD is mounted while your iPod is connected then your podcasts
will be refreshed again even if the script has already done it once.

Use the folder action's ability to get information about the added item...


on adding folder items to this_folder after receiving added_items
tell application "Finder" to set theName to name of item 1 of added_items
if theName is "My_iPod_Name" then
--do the iTunes stuff
end if
end adding folder items to


Nick
pp Mr Tea

--

Brew of the day: Tippy Assam



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/robert% 40elastica.com
Archives: http://lists.apple.com/mailman//archives/applescript-users


This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Applescript to trap when I insert my ipod? (From: Mr Tea <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.