Reco Label Stringer
Reco Label Stringer
- Subject: Reco Label Stringer
- From: Andy Wylie <email@hidden>
- Date: Thu, 25 Apr 2002 18:04:27 +1200
I didn't get any bites with the earlier tease so here's a worker...
----------------
set listA to {frog:"froggie", dog:"fido", cat:"kitty", |cane toad|:"dairy
queen", hamster:"hammy"}
set ick1 to ({listA} as string)
set AppleScript's text item delimiters to {"TEXT"}
set count1 to count listA
set ick2 to ick1's text items 2 thru (count1 * 2)
set AppleScript's text item delimiters to ""
set {strungLabel, shoo} to {{}, (ASCII character 0)}
repeat with n from 1 to (count1 * 2) by 2
tell (ick2's item n)
if (its text item -1) = shoo then
set itsEnd to -2
else
set itsEnd to (its length)
end if
set end of strungLabel to (its text items 5 thru itsEnd as string)
end tell
end repeat
set critter to (choose from list strungLabel)'s item 1
set AppleScript's text item delimiters to {critter}
set thisCritter to ick1's text item -1
set AppleScript's text item delimiters to {"TEXT"}
set count2 to count (thisCritter's text items)
set AppleScript's text item delimiters to ""
set itsName to (listA's every string)'s item (round (count1 - ((count2 / 2)
- 1)) rounding down)
say "hello " & itsName
----------------
--I believe Arthur Knapp knows how to turn a string into a label ;)
_____________________________ Andy
_______________________________________________
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.