Re: How to create a document?
Re: How to create a document?
- Subject: Re: How to create a document?
- From: Yvan KOENIG <email@hidden>
- Date: Sun, 05 Jun 2016 10:15:04 +0200
and by way of expansion:
set testFile to "This is a test.txt" set thePath to POSIX file ("/Users/<user name here>/Desktop/" & testFile) tell application "TextEdit" activate make new document set text of document 1 to "one two three" set document 1's name to testFile close document 1 saving yes saving in thePath end tell
and to have a script independant of the host, and for lazy typist :
set testFile to "This is a test.txt" set thePath to ((path to desktop as text) & testFile) as «class furl» tell application "TextEdit" activate make new document tell document 1 set its text to "one two three" set its name to testFile close it saving yes saving in thePath end tell end tell
Yvan KOENIG running El Capitan 10.11.5 in French (VALLAURIS, France) dimanche 5 juin 2016 10:15:00
|
_______________________________________________
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