Attaching a recording to an email

All,

I admit to being a complete AppleScript noob, but was hoping a kind soul could help me out. I am trying to hack an existing script included with the freeware Audio Recorder app (below). The script creates a new message in Apple Mail with the most recently recorded file as an attachment, but I use Entourage right now and the syntax needed seems to be totally different.

Thanks in advance,
Lars

–

tell application “Audio Recorder”
set theFilePath to the current file path
if theFilePath is not “” then
tell application “Mail”
set theMessage to make new outgoing message with properties {content:return & return}
tell theMessage
set visible to true
tell content
make new attachment with properties {file name:theFilePath} at after the last paragraph
end tell
end tell
end tell
end if
end tell

Try this:

tell application "Microsoft Entourage" to ¬
	open (make new outgoing message at out box folder with properties {content:return & return, attachment:theFilePath})

Thanks for the suggestion. However, when I run that code from the Script Editor, I get this error msg:

‘Microsoft Entourage got an error: Some data was the wrong type.’

Regards,
Lars

Does this work?

tell application "Audio Recorder" to set theFilePath to current file path
set theFilePath to (text 2 thru -1 of (POSIX path of theFilePath)) as alias
tell application "Microsoft Entourage"
    activate
    open (make new outgoing message at out box folder with properties {content:return & return, attachment:theFilePath})
end tell

Jon

Yes, that works exactly like I need it to - thanks!

I emailed the developer of Audio Recorder earlier and he said he’d be happy to include a script for Entourage with the application as long as someone else wrote it. Can I send this to him?

Regards,
Lars

As long as jj’s cool with it, I have no problem sending it to him.

Jon

Oh, well, er… ok. :rolleyes: