Member
|
[PHP]set txt to ""
set filename to POSIX path of (path to desktop) & "email.txt" tell application "Mail" check for new mail repeat with msg in messages in inbox if id in msg is not equal to id in first message in inbox then set txt to txt & " ### " end if set txt to txt & "From: " & (sender in msg) & " Subject: " & (subject in msg) & " " & (content in msg) end repeat end tell tell application "TextEdit" set textfile to (make new document at beginning with properties {text:txt}) save textfile in filename end tell[/PHP] I'm working on an Applescript to output email to a text file, but I'm encountering a problem. Whenever this is run, instead of saving it to the Desktop, it saves it to the root directory as the file ":Users:usernameesktop:email.txt" instead of the file "email.txt" in my desktop. How do I fix this? Thanks! |
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
not being an Applescript guy I would experiment with writing out all of the variables to that text file just to find out all the values (like the variable 'filename' (shouldn't that file actually be called 'filepath'? Is that a reserved word?), then I would fiddle with the assignations of values to the variables to see what was printed on successive runs of the script... I would essentially be reverse engineering my own code to get my bearings. Ugly, eh?
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
iMac G5 shutdown during sleep problem w/open firmware | kellte2 | Genius Bar | 7 | 2005-11-01 21:21 |
airport express problem problem problem | moo | Genius Bar | 8 | 2005-10-08 19:12 |
Transmission Problem? | ast3r3x | AppleOutsider | 18 | 2005-04-28 11:36 |
Question about IBook problem and Applecare | mdeloria | Genius Bar | 6 | 2005-03-23 17:27 |
Serious problem, Help or advice needed. | stevegong | Genius Bar | 20 | 2004-07-27 21:04 |