I am not sure how to approach this issue. I have two hard drives installed on my PowerMac. I have my iTunes pointed to the second drive, which is where I store all the music files for my iPod. I have some pretty weird stuff, and a friend that enjoys some of my weird tracks. So, I put this script together to easily send him a track now and then:
--Kimbo Music Send
set bb to (choose file with prompt "Pick a music file to attach:") --Do not use [as unicode text] here
tell application "Mail"
set b to make new outgoing message with properties {sender:"casdvm@tacomacat.com", subject:"Music"}
tell b to make new to recipient
set content of b to ("Kimbo:
" & (text returned of (display dialog "Message Today:" default answer ""))) & return & return & "Craig" & return & return
tell b's content --Remember to reference the [b] variable, stupid!
make new attachment with properties {file name:bb} at after the last paragraph
end tell
set address of first to recipient of b to "kimbotheyounger@comcast.net"
send b
end tell
Here is the Event log when I choose a file from the second drive:
tell current application
choose file with prompt “Pick a music file to attach:”
“User canceled.”
I tried clicking the Cancel button instead of Choose, and got the same response. If, however, I choose a file from the primary drive, everything runs smoothly and the message is sent. Additionally, if I just go into Mail, make a new message, and attach the file from there, the message is sent with the proper attachment.
I read through the dictionary for [choose file] in Standard Additions, but could find nothing that seemed worth trying.
Any ideas?
ADDENDUM
This appears to be a Spotlight issue. It works fine if you follow all the trees to the desired file, but if you choose a file using the Spotlight search window, it errors. I have not tried that with the native drive, but I suspect it is the same.