On Saturday, January 20, 2018 at 8:52:51 AM UTC-5, Bernardo wrote:
>
> OK, I found this applescript that could do the job but, as I'm a total
> applescript newbie, I don't know how to retreive the last search string
> (the one which populate the built-in search dialog). This prev search
> should replace in the following PREV_SEARCH_STRING script.
>
> Thanks for your help.
>
>
> (*
>> This Applescript lets you do a search starting at the top of the current
>> document, NOT where the cursor is currently positioned
>> Author: Ryan Wilcox
>> Date: June 17, 2014
>> License: Public Domain
>> *)
>>
>> tell application "BBEdit"
>> set theChoice to display dialog "Search current document for:"
>> default answer PREV_SEARCH_STRING
>>
>> if button returned of theChoice is "OK" then
>> set searchOpt to {starting at top:true, wrap around:false}
>> set oldSearchString to text returned of res
>> tell window 1
>> set findRes to find (text returned of res) options searchOpt
>> with selecting match
>> if findRes's found is false then beep
>> end tell
>> end if
>> end tell
>>
>
>
I'm working with a slightly earlier version of BBEdit, but AppleScript
editor's dictionary for BBEdit shows a "current search strings" property,
so try this at the start of the script:
*set* PREV_SEARCH_STRING *to* current search strings
*set* PREV_SEARCH_STRING *to* search string *of* PREV_SEARCH_STRING
I can't seem to directly:
set PREV_SEARCH_STRING to search string of PREV_SEARCH_STRING
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.