• 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: new line when writing to text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new line when writing to text file


  • Subject: Re: new line when writing to text file
  • From: Tim Mansour <email@hidden>
  • Date: Wed, 24 Mar 2010 14:51:15 +1100

You look pretty close to me Jack. Try this:

set PerDiemFile to (path to desktop folder as string) & "PerDiem.txt"
set WorkingFile to open for access file PerDiemFile with write permission
set eof WorkingFile to 0
set FileContent to pilotName & "'s Pilot Per Diem Logbook " ¬
    & taxYear & return ¬
    & city & return ¬
    & perdiemItem & return ¬
    & amountForItem & return
write FileContent to WorkingFile
close WorkingFile


On 24 March 2010 14:28, Jack Schwart <email@hidden> wrote:
> Hi guys, anybody know what I'm doing wrong here...
> I am trying to input data into a text file, with each successive entry on a
> new line.
> I tried both...
> " \r " and
> " &return" to no avail.  Either it wouldn't compile or I got an error code
> for incompatible data type.
> Here's what I have so far...
>
>
> set PerDiemFile to (path to desktop folder as string) & "PerDiem.txt"
> set WorkingFile to open for access file PerDiemFile with write permission
> set eof of WorkingFile to 0 -- Overwrites existing file to start from
> scratch
> write pilotName & "'s Pilot Per Diem Logbook "
> & taxYear & return & return to WorkingFile starting at (get eof WorkingFile)
> write city to WorkingFile as string   -- what should go here to get it to
> skip to the next line?
> write perdiemItem to WorkingFile as string
> write amountForItem to WorkingFile as string  -- same question here....how
> do I get it to skip a line after this input?
>
> It writes the first line of data correctly, skips two lines, but that's the
> best I can do. After that, all data
> is put in a straight line.
> Thanks for any help,
> Jack
>  _______________________________________________
> 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
>
>



--
Tim Mansour <email@hidden>
Neologica Print & Promotions ABN 63 904 335 408
PO Box K1163 : Haymarket NSW 1240
Mobile 0405 500 846 : Melbourne in-dial 03 9012 7441
 _______________________________________________
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: new line when writing to text file
      • From: Tim Mansour <email@hidden>
References: 
 >new line when writing to text file (From: Jack Schwart <email@hidden>)

  • Prev by Date: new line when writing to text file
  • Next by Date: Re: new line when writing to text file
  • Previous by thread: new line when writing to text file
  • Next by thread: Re: new line when writing to text file
  • Index(es):
    • Date
    • Thread