Re: Saving to desktop with TextEdit - El Capitan vs Sierra [2]
Re: Saving to desktop with TextEdit - El Capitan vs Sierra [2]
- Subject: Re: Saving to desktop with TextEdit - El Capitan vs Sierra [2]
- From: "email@hidden" <email@hidden>
- Date: Sat, 24 Dec 2016 14:48:19 -0500
Axel,
I'm very much a newbie at AppleScript, but I tried the below just to see what I got. And I may not have done it right.
I commented out each of the various save options, then uncommented them one at a time. I ran under Script Editor.
The first two resulted in a permissions problem, and the last three continued running for ever. Okay, well, at least until I forced Script Editor to quit.
-----===== Bill =====----- --
EARTH FIRST! We'll strip mine the other planets later
On Dec 24, 2016, at 10:54 AM, Axel Luttgens < email@hidden> wrote:
-- Let’s be sure to start with something to save. tell application "TextEdit" make new document end tell
-- Saving to a POSIX file. set newFile to POSIX file (POSIX path of (path to desktop) & "test1.rtfd") tell application "TextEdit" tell document 1 save in newFile end tell end tell
-- Saving to a POSIX file ('path to desktop' returns in this case the same as above). -- Note that the "my" keyword is needed. tell application "TextEdit" tell document 1 set newFile to my POSIX file (POSIX path of (path to desktop) & "test2.rtfd") save in newFile end tell end tell
-- Saving to an alias built on the fly, the file being non existent. -- Note the "alias … of document 1" in Script Editor's log. -- Would have expected a failure here, but no… set newFile to ((path to desktop as text) & "test3.rtfd") tell application "TextEdit" tell document 1 save in alias newFile end tell end tell
-- "Saving to a string" - a posix path. -- Fails under El Capitan (as expected, would I be tempted to say) set newFile to (POSIX path of (path to desktop) & "test4.rtfd") tell application "TextEdit" tell document 1 save in newFile end tell end tell
-- "Saving to a string" - an HFS path. -- Fails under El Capitan (as expected, would I be tempted to say) set newFile to ((path to desktop as text) & "test5.rtfd") tell application "TextEdit" tell document 1 save in newFile end tell end tell
tell application "TextEdit" quit end tell
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden