• 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: Problem saving a new file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Problem saving a new file
      • From: Christopher Stone <email@hidden>
References: 
 >Re: Problem saving a new file (From: Eric Robertson <email@hidden>)
 >Re: Problem saving a new file (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Problem saving a new file
  • Next by Date: Re: Problem saving a new file
  • Previous by thread: Re: Problem saving a new file
  • Next by thread: Re: Problem saving a new file
  • Index(es):
    • Date
    • Thread