AppleScript to "funnel" MP3s to a non-Mac player

Hi Silversleeves,

what’s about using a handler to specify the volume.
Values stored in top level properties are persistent until the script will be recompiled.
At first start you will asked to choose a volume with your criteria if more than one is available,
otherwise the single volume is taken automatically, or you get an error message, if none is mounted.
Next start the saved volume will be recognized at once.

property theVolume : ""

if check_Volume() is false then return

on check_Volume()
	tell application "System Events" to set diskList to name of disks whose capacity < 1.0E+10 and ejectable is true and local volume is true and format is not audio format
	if theVolume is "" or theVolume is not in diskList then
		if (count diskList) is 0 then
			display dialog "No volumes found" buttons {"OK"} default button 1 with icon stop giving up after 3
			set theVolume to false
			return
		else if (count diskList) is 1 then
			set theVolume to item 1 of diskList
		else
			repeat
				set theVolume to choose from list diskList with prompt "Choose volume"
				if theVolume is not false then
					set theVolume to item 1 of diskList
					exit repeat
				end if
			end repeat
		end if
	end if
	return theVolume
end check_Volume

Thanks StefanK. I’ll certainly think about it.

But with the latest modified one I have, now the question runs through my head: “To Dock or not to Dock?”

I customised the icon for the original StickEjector. It would take next to no time to migrate that icon over to the new one. Putting it in the Dock saves me the trouble of trying to remember where I tucked it away on my system. On the other hand, as I do have one USB thumb drive formatted HFS+, to copy the ejector applet to the Dock might presage my trying to use it on all my USB sticks. One more thing to puzzle over.

Silversleeves