Hey guys,
I have been using this script on another machine using an automator workflow, and it has been running fine.
When I switch to a different computer I got the following error:
Applescript Error
End of line (-39)
Here is the following applescript I found that I have been using:
Automator highlighted read sourcFile in the line:
"set theletter to read sourceFile"
Any idea what's going on here? Any help would be greatly appreciated.
I have been using this script on another machine using an automator workflow, and it has been running fine.
When I switch to a different computer I got the following error:
Applescript Error
End of line (-39)
Here is the following applescript I found that I have been using:
Code:
--direct to your plain text file with addresses, and name, tab delimited
set sourceFile to open for access "Macintosh HD:Users:CS4:Movies:address.txt"
set theAddressDOC to read sourceFile
close access sourceFile
set pcount to count paragraphs in theAddressDOC
repeat with i from 1 to number of paragraphs in theAddressDOC
set this_item to paragraph i of theAddressDOC
set Name_text to "" -- set to blank
-- using try so if there is a an error, in this case it will be when the is no name, the script will carry on
-- instead of stopping. The Name_text will reamin as "" if it does
try
--use delimiters (tab) in this case to split the result of this_item and try to set Name_text to the name
set AppleScript's text item delimiters to tab
set para_text to text of this_item
--get the second half of paragraph
set Name_text to text item 2 of para_text
end try
--get the first half of paragraph
set address_text to text item 1 of para_text
--reset the delimiters
set AppleScript's text item delimiters to ""
set theAddress to address_text
-- direct to a doc of what you want the email to say in plain text
set sourceFile to open for access "Macintosh HD:Users:CS4:Movies:web links body text.txt"
set theletter to read sourceFile
close access sourceFile
-- What is the subject of the Emails
set theSubject to "Here Are Your Requested Uploaded Links"
-- Check to see if Name_text contains a name or not
if Name_text is "" then
--if no name
set theBody to " you to view" & theletter
else
--the must be a name
set theBody to "Here are the links for " & Name_text & theletter
end if
theBody
-- Choose the account to send the message from
set theSender to "cscomcastcable@gmail.com"
tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
-- Default is false. Determines whether the compose window will
-- show on the screen or whether it will happen in the background.
set visible to true
set sender to theSender
make new to recipient at end of to recipients with properties {address:theAddress}
tell content
tell application "Mail"
send newMessage
end tell
-- delay to allow the Mail program to send and not bog down, adjust as needed
delay 10
end tell
end tell
end tell
end repeat
Automator highlighted read sourcFile in the line:
"set theletter to read sourceFile"
Any idea what's going on here? Any help would be greatly appreciated.