• 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: Look for prefix, if no match display alert.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Look for prefix, if no match display alert.


  • Subject: Re: Look for prefix, if no match display alert.
  • From: Adam Bell <email@hidden>
  • Date: Sat, 26 Aug 2006 15:42:35 -0300

Title: Re: Look for prefix, if no match display alert.
At 5:27 PM +0200 8/25/06, Jan Bultereys wrote:
HI, does anyone knows how to make this shorter and faster?
Let me explain what it does and what I want:

If a page starts with GF1 then there should be 'content' in the page that has a GF1- prefix
If there is other content (prefix) like GF2, AF7, YF2 ...... Display it on screen.

This example is only covering a page that starts with GF1, of course I want to cover also GF2,GF3...AF1,YF3.... Pages

I'm not sure this is faster, but it's much shorter, and you call it once at the beginning to get all the prefixes as an array called prefix:

set prefix to setPrefix()
set pfx to item 10 of prefix's item 2 --> "AFD"
set pfx to item 12 of prefix's item 4 --> "KFN"

to setPrefix()
  
set {GF, AF, YF, KF} to {{}, {}, {}, {}}
       
copy {GF, AF, YF, KF} to group
 
set len to {9, 12, 12, 12}
     
set family to {"GF", "AF", "YF", "KF"}
 
set pNum to "123456789DHN"
     
repeat with j from 1 to 4
              
set fam to family's item j
             
set grp to group's item j
              
repeat with k from 1 to len's item j
                   
set end of grp to fam & character k of pNum
            
end repeat
     
end repeat
     
return group
end setPrefix
Then, in the later part (I don't have Quark), you would be able to run your checks in a repeat loop that referenced the prefixes in the prefix list, and refer to them (as variables) simply by their position in that list.

Adam

 _______________________________________________
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

  • Prev by Date: Look for prefix, if no match display alert.
  • Next by Date: Re: iTunes and persistent ID
  • Previous by thread: Re: Look for prefix, if no match display alert.
  • Next by thread: A few questions about dates
  • Index(es):
    • Date
    • Thread