MACSCRPT Archives

July 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
SUBSCRIBE MACSCRPT Inyo55 <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 7 Jul 2011 18:58:37 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
I am trying to return an error message if I script a find command in 
applescript using BBEdit.  That is, if the searched string is not present in the 
text being searched, I want the script to display an error message and cancel 
the script.

My syntax is:

try
find sigfindname searching in text 1 of text document 1 options {search 
mode:literal, starting at top:false, wrap around:false, backwards:false, case 
sensitive:false, match words:false, extend selection:false} with selecting 
match
on error errmsg
display dialog errmsg
end try

sigfindname is a variable for a string created upstream in the script.  

The applescript totally ignores my command in the TRY statement.  Any 
suggestions?  I also tried using an IF/THEN command using a FALSE result 
returned, but that did not work either.

thanks,
Bob R.

ATOM RSS1 RSS2