Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescript + iPod help

Applescript + iPod help
Thread Tools
Dedicated MacNNer
Join Date: Jan 2004
Location: Behind you
Status: Offline
Reply With Quote
Nov 18, 2004, 06:02 PM
 
I've been teaching myself applescript recently and one of the things i wanted to do was back up a folder called Uni (my Uni notes funnily enough) from my Powerbooks hard drive on to my iPod as a back up whenever i plug in my iPod. The problem i was having was that i can't figure out how to detect the iPod. ie i can get the script to find the folder and copy it to another location (ie desktop) but i can't get it to put it on my iPod. I can't even get a script to give me a 'true' when i do an 'exists' query trying to find the iPod. Can applescripts not detect external hard drives or aam i being stupid?

Sorry, i'm very new to this.
Soon we'll be out, amid the cold worlds strife,
Soon we'll be sliding down the razor blade of life
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Nov 18, 2004, 10:38 PM
 
Here is a quick script that should get you in the right direction:
Code:
set myIPodName to "the name of my ipod" tell application "System Events" set thisArray to the disks set myIPod to null repeat with thisDisk in thisArray if displayed name of thisDisk as string is myIPodName then set myIPod to thisDisk exit repeat end if end repeat if myIPod is not null then get POSIX path of myIPod end if end tell
You probably should have a good look through the dictionary for "System Events" as it contains a lot of useful things.

The other hint (that I will let you solve yourself) is that there are a few approaches to try ing to detect when an iPod get mounted. One is to set a folder action on /Volumes... this is a bit hackish, and I am not sure it will work in all cases. The second is to create a "stay alive" script with an on-idle handler... there is plenty of documentation on this out there to be googled.
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 09:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2