Moving a file after text has been added.
I am adding a text line to the file and after doing so, I want the file moved to another folder.
tell application "Finder"
set the_file to ("Macintosh HD:Users:chipthomas:Dropbox:Apps:Attachments:Daily Live Net Sales Gmail:Daily Live Net Sales Gmail.csv" as alias)
set the_text to (read (the_file as alias))
set the_date to (creation date of the_file) as string
set the_date to word 1 of the_date & items ((count word 1 of the_date) + 2) thru ((count word 1 of the_date) + (count word 2 of the_date) + (count word 3 of the_date) + 3) of the_date & items ((count word 1 of the_date) + (count word 2 of the_date) + (count word 3 of the_date) + 5) thru -1 of the_date
set the_text to "\"Report Date\",\"" & the_date & "\"" & return & the_text
set the_file to open for access the_file as alias with write permission
write the_text to the_file as string
close access the_file
end tell
tell application "Finder"
move alias to "Macintosh HD:Users:chipthomas:Dropbox:IFTTT:Gmail"
end tell
The top part work, but the bottom does not.
Any suggestions?
Thanks
Chip
iMac 27" 5K, macOS 10.14