Jump to content

problems with mail app (os x)


lolobo
 Share

This topic is 6003 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hello,

I have an applescript to send a freehand file from filemaker. I need to change the freehand mx file to freehand 9 and send it with mail. The script:

set originFolder to desktop folder

set caminoanexo to choose file with prompt "Selecciona el fichero mx"

set EPS_Location to originFolder & caminoanexo & ".fh9" as string

tell application "FreeHand MX"

open caminoanexo without Dialogs

save last document as FH9 in file EPS_Location without IncludeFHDocInEPS

close last document

end tell

tell application "Mail"

set newMessage to make new outgoing message with properties

{subject:"prueba tal y tal", content:"Atenci

Link to comment
Share on other sites

Not really a Filemaker question but I took a stab at it anyway. You need to make three changes to your script (highlighted in bold). This worked in Mail 1.2.5 on my OS X 10.2.8 G4...

set originFolder to desktop folder

set caminoanexo to choose file with prompt "Selecciona el fichero mx"

set EPS_Location to originFolder & caminoanexo & ".fh9" as string

tell application "FreeHand MX"

open caminoanexo without Dialogs

save last document as FH9 in file EPS_Location without IncludeFHDocInEPS

close last document

end tell

tell application "Finder"

set EPS_Location to EPS_Location as alias

end tell

tell application "Mail"

set newMessage to make new outgoing message with properties

{subject:"prueba tal y tal", content:"Atenci

Link to comment
Share on other sites

  • Newbies

thanks Robert, this work!. And only i need to make this change:

tell application "Finder"

set EPS_Location to EPS_Location as alias

end tell

And is a filemaker question! but i resume the script to only the no working part smile.gif I use filemaker in the script to make the outgoing message (adresss, subject, text, etc) smile.gif If anyone are interested in this, please post or send me a msg.!! Thx Robert!!

Link to comment
Share on other sites

  • Newbies

The script run from filemaker and as standalone application. The whole script:

set originFolder to desktop folder

set caminoanexo to choose file with prompt "Selecciona el fichero con el material a enviar"

set EPS_Location to caminoanexo & ".fh9" as string

tell application "FreeHand MX"

open caminoanexo without Dialogs

save last document as FH9 in file EPS_Location without IncludeFHDocInEPS

close last document

end tell

tell application "Finder"

set EPS_Location to EPS_Location as alias

end tell

--this part get the filemaker data. U need to define this fields.

tell application "FileMaker Developer"

set the_subject to the cell "subject" of current record of layout "Ordenes"

set the_subject2 to the cell "subject2" of current record of layout "Ordenes"

set the_sender to the cell "emailsender" of current record of layout "Ordenes"

set email_envio to the cell "email" of current record of layout "Ordenes"

end tell

--This part make the message and send it.

tell application "Mail"

set newMessage to make new outgoing message with properties {subject:the_subject & the_subject2}

tell newMessage

set sender to the_sender

make new to recipient at end of to recipients with properties {address:email_envio}

tell content

make new attachment with properties {file name:EPS_Location} at after the last paragraph

end tell

send newMessage

end tell

end tell

That's all!!!

Lolo

Link to comment
Share on other sites

  • 1 year later...

Hi there,

Just came across this thread and tried out a simplified version of it via the Apple Script Editor but cannot get it to work. I was wondering if anyone could take a look and let me know where I am going wrong.

tell application "Mail"

set newMessage to make new outgoing message with properties {subject:"Test Email From Filemaker", content:"Test email content"}

tell newMessage

set sender to "[email protected]"

make new to recipient at end of to recipients with properties {address:"[email protected]"}

tell content

make new attachment with properties {file name:"Hard Disk:Users:markbowen:Desktop:Uploader:account.php"} at after the last paragraph

end tell

send newMessage

end tell

end tell

This sends an email message okay with the to address, from address and subject and body but no attachment is added in. Could someone let me know where I am going wrong. I was pretty sure that I had all the code correct.

Also is there a way instead of sending the email to place it into the 'Drafts' folder instead so that you can send it later?

Any help with this would be greatly appreciated.

Regards,

Mark Bowen

Link to comment
Share on other sites

Hi there,

Are you originally from Birmingham then. Why did you move to Canada?

Thanks for the heads up. After a lot of head scratching and code tweaking I saw this in a small applet someone had made and tried it and it worked! Thanks for the post though.

Take care,

Mark

Link to comment
Share on other sites

This topic is 6003 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.