Re: Problem saving a new file
Re: Problem saving a new file
- Subject: Re: Problem saving a new file
- From: Axel Luttgens <email@hidden>
- Date: Sun, 21 Oct 2012 12:47:56 +0100
Le 20 oct. 2012 à 22:14, Christopher Stone a écrit :
> [...]
>
> This works with TextEdit 1.8 on Mountain Lion. Note that it saves to the Desktop. Trying to save to Documents fails no matter what embedded folder I try.
>
> ------------------------------------------------------------------------------------------------
> tell application "TextEdit"
> set newFile to (((path to desktop folder) & "Test_File.rtf") as text) as «class furl»
> set _text to "Here is some sample text."
> set newDoc to make new document with properties {text:_text}
> save newDoc in newFile
> end tell
> ------------------------------------------------------------------------------------------------
Hello Christopher,
Looks like application sandboxing enters into the game with the above.
Just put the path to call outside of the tell block, and the "regular" Documents folder is available again:
set newFile to (((path to documents folder) & "Test_File.rtf") as text) as «class furl»
tell application "TextEdit"
set _text to "Here is some sample text."
set newDoc to make new document with properties {text:_text}
save newDoc in newFile
end tell
Axel
_______________________________________________
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