🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17937

Re: Best way to store program info

#17937
From: John Darnell
Date: Thu, 08 May 2003 20:27
33 lines
2281 bytes
Ole:

Actually, I'm looking at that right now. I built a dummy file (twenty lines of real records (first and last record are real) and 260 lines of dummy records about the same size of what a real record would be.

I then loaded the file into an Applescript list using a repeat loop (If there's a better way, I'm all ears) looking something like this:

repeat
  read a line in
  parse the line into the three fields
  store the fields in a record
  store the record in a list
end repeat

reading in all 295 lines of approximately 40 characters each took 4 seconds (timed using a set start/end current date and subtracting the two values).

I then did a search for the first record in the file, which took no time at all, but searching for the last font in the list took two seconds. A two second overhead per font in a script that may look for as many as fifty fonts may not be acceptable.

Again, I used a repeat loop. The repeat loop looked something like this:

repeat with i in fontlist
   if FontMnemonic = key of i
       store font info in temp vars
       exit repeat
    end if
end repeat

If there is a better way to search through a list of records, then I'm all ears.

I haven't given up on optimizing this process.

I really appreciate your input, Ole. Next time you're out here in lovely Brookfield, I'll treat you to dinner at the new Mexican restaurant that just opened up (it actually has good food). That goes for anyone else who has helped me out, and who shows up on my (work) doorstep.

John
Technical Details
Message-ID: <1de909c4.3@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de909c4.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,e360e25432baca67
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-08 13:38:13 PST
From: "John Darnell" <John.Darnell@Walsworth.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Best way to store program info
Message-ID: <1de909c4.3@WebX.la2eafNXanI>
Date: Thu, 8 May 2003 13:27:19 -0700
References: <1de909c4.-1@WebX.la2eafNXanI>
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit