Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Fax forward to email applescript

Fax forward to email applescript
Thread Tools
jorgemendez
Fresh-Faced Recruit
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 15, 2006, 01:50 PM
 
Good Day All,

I'm very happy with my new OS X 10.4 install. But I’m having a bit of difficulty with a feature in OS X faxing. What I would like to do is have faxes that come in forward to an email address but since os x is using its own smtp server and its not an authenticated smtp server the email never gets delivered.

So what i would like to do is to have the mail program automatically send the email using my personal email too two or three email addresses when a fax comes in.

If anyone has any suggestions as to how to do this please let me know.


Jorge Mendez
     
tooki
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Nov 15, 2006, 02:16 PM
 
Have the OS save incoming faxes to a folder, then create a Folder Action for that folder that tells your email client to email any file that lands in that folder.

tooki
     
jorgemendez  (op)
Fresh-Faced Recruit
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 15, 2006, 04:05 PM
 
I found the following under folder actions but i do not know how to customize this to have an email generated when there is a new folder change.


-
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
--get the name of the folder
set the folder_name to the name of this_folder
end tell


-- find out how many new items have been placed in the folder
set the item_count to the number of items of the added_items
--create the alert string
set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
if the item_count is greater than 1 then
set alert_message to alert_message & (the item_count as text) & " new items have "
else
set alert_message to alert_message & "One new item has "
end if
set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")


display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
set the user_choice to the button returned of the result

on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
--get the name of the folder
set the folder_name to the name of this_folder
end tell

--
     
jorgemendez  (op)
Fresh-Faced Recruit
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 15, 2006, 05:36 PM
 
I’m trying to read and understand the applescript language but I’m having a hard time putting it all together. Currently I have all faxes in Sites/faxes/ directory under a user. When faxes come in they are placed in this folder. I found an applescript to create a new email message, I found an applescript to look at the folder changes but I don’t know how to even go about putting the two together to get what I need. Does anyone have an applescript that does this?

Thank you
     
Tsilou B.
Senior User
Join Date: May 2002
Location: Austria
Status: Offline
Reply With Quote
Nov 15, 2006, 05:38 PM
 
You don't have to use AppleScript for a task so simple. Just use Automator:

Open Automator
Switch to the "Mail" category
Drag the "New Mail message" to the workflow and fill out everything
Drag the "Send outgoing messages" to the end of the workflow
In the File menu, select "Save as Plugin"
Choose "Plugin for: Folder Actions"
Select the folder where your faxes are saved in the "Attached to folder" menu
If you haven't enabled Folder actions already, there will be a check box called "Enable folder actions" you should click.
Click "Save"

That's it. Much easier to use than AppleScript if you're not a programmer.
     
jorgemendez  (op)
Fresh-Faced Recruit
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 16, 2006, 10:13 AM
 
Thanks you for your reply and this works perfecty on my OS 10.4 machine...but 10.3 does not have automate....how can i do this in OS 10.3?


Jorge Mendez
     
Tsilou B.
Senior User
Join Date: May 2002
Location: Austria
Status: Offline
Reply With Quote
Nov 16, 2006, 04:31 PM
 
Copy the following AppleScript and fill in the correct recipient:

Code:
on adding folder items to this_folder after receiving added_items try tell application "Mail" set newMessage to make new outgoing message with properties {subject:"Fax received", content:"The fax is attached."} tell newMessage make new to recipient with properties {address:"[email protected]"} end tell tell content of newMessage repeat with theItem in added_items try make new attachment with properties {file name:theItem} at after the last paragraph end try end repeat end tell send newMessage end tell end try end adding folder items to
Note: the line 'set newMessage to make new outgoing message with properties {subject:"Fax received", content:"The fax is attached."}' has to be a single line.
Then save the script to your "/Library/Scripts/Folder Action Scripts" folder and attach the script to the fax folder (e.g. with the "Folder Actions Setup" application in the "Applications/AppleScript" folder).
     
jorgemendez  (op)
Fresh-Faced Recruit
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 20, 2006, 10:04 AM
 
Thank you for the script it is working great...If you dont mind me asking did you write the script or where you able to generate the script from the animator actions?


Jorge Mendez
     
Tsilou B.
Senior User
Join Date: May 2002
Location: Austria
Status: Offline
Reply With Quote
Nov 20, 2006, 02:45 PM
 
Unfortunately I had to write the script. I think it's not possible to generate scripts from Automator.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:01 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,