• 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: Script Debugger 5: Find Next Marker Rev2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Debugger 5: Find Next Marker Rev2


  • Subject: Re: Script Debugger 5: Find Next Marker Rev2
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 14 Sep 2012 08:06:19 -0500

Hey Folks,

I had to make an alteration to accommodate a marker at the beginning of line 1.

--
Best Regards,
Chris

---------------------------------------------------------------------
#       Author: Christopher Stone <email@hidden>
#      Created: 2012-09-14 : 06:55
#     Modified: 2012-09-14 : 08:04
#  Application: Script Debugger
#      Purpose: Find the next Marker
# Dependencies: Satimage.osax
---------------------------------------------------------------------
on fnd(findStr, srcData, startPos, caseSensitive, allOccurrences, stringResult)
  try
    set findResult to find text findStr in srcData ¬
      starting at startPos ¬
      case sensitive caseSensitive ¬
      all occurrences allOccurrences ¬
      string result stringResult ¬
      with regexp
    return findResult
  on error
    return false
  end try
end fnd
---------------------------------------------------------------------
on fndBool(findStr, srcData, caseSensitive, allOccurrences, stringResult)
  try
    set findResult to find text findStr in srcData ¬
      case sensitive caseSensitive ¬
      all occurrences allOccurrences ¬
      string result stringResult ¬
      with regexp
    return true
  on error
    return false
  end try
end fndBool
---------------------------------------------------------------------
try
  set _mark to "--»"
  tell application "Script Debugger"
    if document 1 exists then tell document 1
      set _SRC to source text
      if (fndBool(_mark, _SRC, false, false, false) of me) = true then
        try
          set {startPos, null} to character range of selection
          set fRec to fnd(_mark, _SRC, startPos, false, false, false) of me
          if fRec ≠ false then
            set selection to {(matchPos of fRec) + 1, matchLen of fRec}
          else
            set startPos to 0
            set fRec to fnd(_mark, _SRC, startPos, false, false, false) of me
            set selection to {(matchPos of fRec) + 1, matchLen of fRec}
          end if
        end try
      end if
    end tell
  end tell
on error eMsg number eNum
  # stdErrAS(eMsg, eNum, true, true) of me
  stdErrAS(eMsg, eNum, true, false) of me
end try
---------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Script Debugger 5: Find Next Marker (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Script Debugger 5: Find Next Marker
  • Next by Date: Re: List Current MacUpdate Items
  • Previous by thread: Re: Script Debugger 5: Find Next Marker
  • Next by thread: Getting Current Slide in PowerPoint
  • Index(es):
    • Date
    • Thread