• 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: Using Applescript to save a text file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Applescript to save a text file?


  • Subject: Re: Using Applescript to save a text file?
  • From: Dave Balderstone <email@hidden>
  • Date: Tue, 27 Apr 2004 16:10:14 -0600

On 27-Apr-04, at 3:21 PM, PiercyWorld wrote:

set my_log to "This file can not be opened by this program. Please try another format. Thank You!"
open for access my_log
save as file my_log to (path to desktop) as "log.txt"

Compare the above with the below

----
set _TempFile to ((path to desktop) & "log.txt") as text
set _Text to "This file can not be opened by this program. Please try another format. Thank You!"

try
close access file _TempFile -- Make sure the file wasn't accidentally left open
end try

open for access file _TempFile with write permission
set eof file _TempFile to 0 -- clear the file contents
write _Text to file _TempFile starting at eof
close access file _TempFile
----
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Using Applescript to save a text file? (From: PiercyWorld <email@hidden>)

  • Prev by Date: Re: Well, I'm Confused...
  • Next by Date: Re: Posting to a USENET Newsgroup in an Applescript?
  • Previous by thread: Re: Using Applescript to save a text file?
  • Next by thread: Re: Using Applescript to save a text file?
  • Index(es):
    • Date
    • Thread