Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mac'n'nz

macrumors newbie
Original poster
May 17, 2010
23
0
Havelock North, New Zealand
Hey all. I have an external drive with my entire iTunes media folder on it, linked to iTunes . If the external is ejected or turned off , iTunes cannot locate the files .

This has happened a couple of times by accident . It's easy to reload the media ( exit iTunes and re-open it) but the album artwork seems to stuff up . Eg heaps of missing artwork , swapped artwork etc.

I was wondering if its possible to run a script that will display the message "'please make sure external hard drive Is on before opening iTunes" when iTunes is opened .

It could either delay by 10 seconds or so, or even better ask " is the external on" and if the answer is "yes" then iTunes will open .

Forgive my noobness, only ever done windows batch files so my knowledge is very little .

Thanks in advance guys :)
 
Try this :

Code:
-- Change POMP to the name of your external disk
-- iTunes will only launch if the disk exists eg visisble in Finder
tell application "Finder" to set diskExists to exists disk "POMP"
set theResult to button returned of (display dialog "Is the external on" buttons {"Cancel", "Yes"} default button 2)
if theResult is "Yes" and diskExists then
	tell application "iTunes" to launch
else
	display dialog "Disk \"POMP\" is not on."
end if

There are other ways to do this but you can give it a go.
 
Try this :

Code:
-- Change POMP to the name of your external disk
-- iTunes will only launch if the disk exists eg visisble in Finder
tell application "Finder" to set diskExists to exists disk "POMP"
set theResult to button returned of (display dialog "Is the external on" buttons {"Cancel", "Yes"} default button 2)
if theResult is "Yes" and diskExists then
	tell application "iTunes" to launch
else
	display dialog "Disk \"POMP\" is not on."
end if

There are other ways to do this but you can give it a go.


Sorry - what is POMP ETC?
 
Sorry - what is POMP ETC?

POMP is the name of my USB stick I used as an example. When you plug in your external drive it should be visible with a name under DEVICES in the Finder Sidebar. If not go to Finder-->Preferences and make sure External Disks is checked in the Show these items in the Sidebar section of the Sidebar tab.
So if the name of your external drive is MyBigDiskWithMyEntireiTunesMediaOnIt then replace POMP in the script with MyBigDiskWithMyEntireiTunesMediaOnIt.
 

Attachments

  • Picture 1.png
    Picture 1.png
    95.7 KB · Views: 91
  • Picture 2.png
    Picture 2.png
    8.3 KB · Views: 126
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.