• 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
Finding offset in string from within QuarkXPress
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
---------------------------------


  • Prev by Date: Re: Script running the wrong application
  • Next by Date: Re: Attaching a folder action
  • Previous by thread: Re: Script running the wrong application
  • Next by thread: Last One - Replacing Chars of file name - I HATE TIDs.
  • Index(es):
    • Date
    • Thread