Applescript Errors with Mail
I made this quick Applescript application and it gave me an error, here is
the coding:
set buyannounce to "AUTOMATIC SERVER EMAIL : BUY"
set transferannounce to "AUTOMATIC SERVER EMAIL : TRANSFER"
set signupannounce to "AUTOMATIC SERVER EMAIL : SIGNUP"
set sellannounce to "AUTOMATIC SERVER EMAIL : SELL"
set nowsignup to "0"
set announce to "AUTOMATIC SERVER EMAIL"
set ¬
currentSignups ¬
to the text returned ¬
of (display dialog ¬
¬
"How many current signups?" default answer "")
tell application "Mail"
set unreadMessages to (get every message of mailbox "INBOX" of account
"Yahoo" whose read status is true)
repeat with eachMessage in unreadMessages
if announce is in (get content of eachMessage) then
if buyannounce is in (get content of eachMessage) then
--buy email
end if
if transferannounce is in (get content of eachMessage) then
--transfer email
end if
if signupannounce is in (get content of eachMessage) then
set nowsignup to nowsignup + 1
set eachMessageTrimmed to ((characters 33 thru -1 of (get
content of eachMessage)) as string)
display dialog nowsignup
set filepath to POSIX path of
"/Users/obleopold/Dropbox/Accounts.csv"
try
set command to "open " & quoted form of filepath
do shell script command
end try
delay 10
repeat currentSignups times
tell "System Events" to keystroke return
end repeat
repeat nowsignup times
tell "System Events"
keystroke eachMessageTrimmed --here is where I am
getting the error
end tell
tell "System Events" to keystroke return
currentSignups = currentSignups + nowsignup
set nowsignup to "0"
end repeat
end if
if sellannounce is in (get content of eachMessage) then
--sell email
end if
end if
end repeat
end tell
end
end
end
end
No comments:
Post a Comment