• 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: specifying a new file (without "choose file name...")?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: specifying a new file (without "choose file name...")?


  • Subject: Re: specifying a new file (without "choose file name...")?
  • From: "Adam K. Wuellner" <email@hidden>
  • Date: Wed, 22 Sep 2004 09:52:40 -0500


On Sep 22, 2004, at 9:30 AM, Adam K. Wuellner wrote:
On Sep 20, 2004, at 10:29 AM, Adam K. Wuellner wrote:
tell application "Affrus"
	make new document with properties {name:filename_}
	save result in file_
end tell
-->	Affrus got an error: Out of memory. (-108)

[...]The second argument to 'save...' should be a 'file', according to Affrus's dictionary. The only 'file'-type thing that seems to work is the furl returned by 'choose file name', [...]

Well, to be fair, a reference to an existing file also works, but I'm trying to create _new_ files, not save existing ones.


With a nudge from the 'How write to a file in an invisible folder?" [sic], I got this to work:

	set file_path_ to (POSIX path of dir_) & filename_
	do shell script "touch " & file_path_
	set file_ to POSIX file file_path_

	tell application "Affrus"
		set doc1_ to make new document with properties {name:filename_}
		set text selection of doc1_ to header_
		select last insertion point of doc1_
		save doc1_ in file_
	end tell

Kludgy?  Indeed.  But it works.

- Adam W

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >specifying a new file (without "choose file name...")? (From: "Adam K. Wuellner" <email@hidden>)
 >Re: specifying a new file (without "choose file name...")? (From: "Adam K. Wuellner" <email@hidden>)
 >Re: specifying a new file (without "choose file name...")? (From: Michelle Steiner <email@hidden>)
 >Re: specifying a new file (without "choose file name...")? (From: "Adam K. Wuellner" <email@hidden>)

  • Prev by Date: Re: Crontab doesn't work for me
  • Next by Date: help with mail.app please
  • Previous by thread: Re: specifying a new file (without "choose file name...")?
  • Next by thread: application file id no go?
  • Index(es):
    • Date
    • Thread