#1266 Find multiple occurences of a string with AppleScript

closed
nobody
None
5
2012-09-20
2012-09-16
John
No

I would like to find and highlight multiple instances of a string using AppleScript. The script "Highlight Occurrences of Text" in the Skim's wiki page about AppleScript unfortunately does not function properly (http://skim-app.sourceforge.net/scripts/Highlight%20Occurrences%20of%20Text.scpt). I think the problem is created from the "find" AppleScript command because when I tried to use it in a simple script (e.g. set theSel to find document 1 text theText) I got in its outcome a list of only one item even if there were more than one instances of theText in the document. Any help is appreciated! I use Skim 1.3.22 and Mountain Lion.
Regards,
John

Discussion

  • This behaves exactly as it is supposed to be. If you want to search multiple occurrences using AppleScript you have to repeat the search until you're done. There is no separate functionality for finding all occurrences, and it is also not necessary.

     
    • status: open --> closed