Re: TextEdit Save Problem (Thomas Maffucci)
Re: TextEdit Save Problem (Thomas Maffucci)
- Subject: Re: TextEdit Save Problem (Thomas Maffucci)
- From: Axel Luttgens <email@hidden>
- Date: Sat, 26 Jan 2013 00:13:27 +0100
Le 24 janv. 2013 à 23:50, koenig.yvan a écrit :
>
> Le 24/01/2013 à 22:55, Christopher Stone a écrit :
>
>> [...]
>> Whups. I forgot to switch to TextEdit 1.8 from 1.6 (which I use on my machine).
>>
>> This should work with 1.8.
>>
>> tell application "TextEdit"
>> set newFile to ((path to desktop folder as text) & "New_File.rtf") 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
>> [...]
>
> Right, this late one works.
Well, yes and no...
Remember, from the thread pointed at by Christopher the other day (http://lists.apple.com/archives/applescript-users/2012/Oct/msg00109.html), let's try this one:
tell application "TextEdit"
path to documents folder
end tell
May be the expected result. Or not. ;-)
Moreover, again from that same thread, the above may be made somewhat less esoteric:
set newFile to POSIX file (POSIX path of (path to desktop folder) & "New_File.rtf")
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