Finding offset in string from within QuarkXPress
Finding offset in string from within QuarkXPress
- Subject: Finding offset in string from within QuarkXPress
- From: David Lloyd <email@hidden>
- Date: Sat, 25 Aug 2001 10:48:52 +1000
Just a snippet I thought I could share for QuarkXPress users for finding
offset in strings.
In my experience finding an offset value from within QuarkXPress conflicts
with the Standard Additions offset syntax...
-----
copy offsetInString("d", "abcdefgh") to theOffset
on offsetInString(theItem, theString)
if theItem "" then
set AppleScript's text item delimiters to theItem
copy (text items of theString) to theItems
set AppleScript's text item delimiters to ""
if (count of theItems) = 1 then
return 0
else
return (length of item 1 of theItems) + 1
end if
else
return 0
end if
end offsetInString
-----
David Lloyd
---------------------------------
email: email@hidden
web:
http://www.kanzu.com
---------------------------------