• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to create a document?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create a document?


  • Subject: Re: How to create a document?
  • From: Bruce Robertson <email@hidden>
  • Date: Sun, 05 Jun 2016 10:12:26 -0700

Result:  a “not saved” dialog

The document “This is a test.txt” could not be autosaved.
Your changes will not be saved until this problem is resolved.


> On Jun 5, 2016, at 9:06 AM, Yvan KOENIG <email@hidden> wrote:
>
> Here is a more efficient scheme.
>
> set testFile to "This is a test.txt"
> --set thePath to (path to desktop as text) & testFile
> --set posixPath to POSIX path of thePath
> set posixPath to POSIX path of ((path to desktop as text) & testFile)
> tell application "TextEdit"
> 	activate
> 	--make new document with properties {path: posixPath} # BEURK , it set the window name but doesn't set the fileName.
> 	--make new document with properties {path: posixPath, name:testFile} # BEURK, it behaves the same !
> 	make new document with properties {path:posixPath} # doesn't set the fileName but correctly set the path
> 	tell document 1
> 		set its text to "one two three"
> 		set its name to testFile
> 		# no need to save here, AutoSave did the job !
> 	end tell
> end tell
>
> I left two disabled make to describe different behaviors.
>
>
> Yvan KOENIG running El Capitan 10.11.5 in French (VALLAURIS, France) dimanche 5 juin 2016 18:04:28
>
>

 _______________________________________________
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


  • Follow-Ups:
    • Re: How to create a document?
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: How to create a document? (From: Mitchell L Model <email@hidden>)
 >Re: How to create a document? (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: How to create a document?
  • Next by Date: Re: How to create a document?
  • Previous by thread: Re: How to create a document?
  • Next by thread: Re: How to create a document?
  • Index(es):
    • Date
    • Thread