Newbies lolobo Posted February 23, 2004 Newbies Posted February 23, 2004 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
jonesy17 Posted February 23, 2004 Posted February 23, 2004 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
Newbies lolobo Posted February 24, 2004 Author Newbies Posted February 24, 2004 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 I use filemaker in the script to make the outgoing message (adresss, subject, text, etc) If anyone are interested in this, please post or send me a msg.!! Thx Robert!!
jonesy17 Posted February 24, 2004 Posted February 24, 2004 You're welcome, lolobo. Actually, I wouldn't mind a copy of the whole script. Does it run separate from Filemaker or is it executed through ScriptMaker?
Newbies lolobo Posted February 25, 2004 Author Newbies Posted February 25, 2004 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
Mark Bowen Posted August 18, 2005 Posted August 18, 2005 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
Daibhead Posted August 18, 2005 Posted August 18, 2005 Hi Mark: How is old Brum : You need to put an alias before the file path "make new attachment with properties {file name:alias"Hard Disk:Users:markbowen:Desktop:Uploader:account .php"} at after the last paragraph" Cheers from Canada
Mark Bowen Posted August 19, 2005 Posted August 19, 2005 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
Recommended Posts
This topic is 7035 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 accountSign in
Already have an account? Sign in here.
Sign In Now