I have a script that opens a text file from a URL in TextEdit. I need to save the open text file to a specific location. Here’s what I have tried but the file isn’t saved anywhere and I get no error message. Not sure what I’m doing wrong.
property TxtFilePath : “/Applications/Clients/TxtFileName.txt”
set ThisTxtFile to TxtFilePath as POSIX file as alias
tell application “Safari” to activate
tell application “System Events”
tell application “Safari”
open location “http://website.com/TxtFileName.txt”
end tell
tell application “TextEdit”
save as ThisTxtFile
quit
end tell
tell application “Safari”
close current tab of front window without saving
end tell
end tell