• 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
Can't set an AppleWorks database field to multi-line value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't set an AppleWorks database field to multi-line value


  • Subject: Can't set an AppleWorks database field to multi-line value
  • From: Eric Goodill <email@hidden>
  • Date: Tue, 21 Jan 2003 23:29:52 -0800

Hi,

I want to append new lines to a multi-line value of an AppleWorks database field. I'm pretty new to AppleScript, but I've had a lot of other scripting experience. I can't seem to find a syntax for appending the contents of a variable to the end of a field's value, so I thought I'd just grab the whole value into a variable, append to the variable, and set the field's value to the contents of the variable. Seems to work except for one thing: all the carriage returns get converted into spaces. Bad Thing.

Here's what I'm doing as a simple example:

tell application "AppleWorks 6"
tell front document
set x to value of field "A" of record 1
set x to {x & return & "abc"} -- not sure why this needs to be a list
set field "A" of record 1 to x
set x to value of field "A" of record 1
end tell
end tell

Here's the Script Editor's event log window after I run this script:

tell application "AppleWorks 6"
get value of field "A" of record 1 of document 1
--> "line1
line2"
set field "A" of record 1 of document 1 to {"line1
line2
abc"}
--> "line1 line2 abc"
get value of field "A" of record 1 of document 1
--> "line1 line2 abc"
end tell

As you can see, I can get a multi-line value as indicated by the line-wrap after in the middle of the returned value after the first get statement. The set statement seems to start out okay with three lines, but it quickly turns into one line.

Any help?

-Eric
_______________________________________________
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.

  • Prev by Date: Re: Fm Insert movie
  • Next by Date: Re: SE2b GUI comments->Abbreviations!
  • Previous by thread: Re: SE2b GUI comments->Abbreviations!
  • Next by thread: UI Scripting: Save as PDF
  • Index(es):
    • Date
    • Thread