Re: Search, start at top and other things

2018-03-03 Thread Christopher Stone
On 02/06/2018, at 23:50, Jean-Christophe Helary 
> 
wrote:
> On Feb 5, 2018, at 11:44, Christopher Stone  > wrote:
>> Under some circumstances you have to expand the property before you can get 
>> to the sub-properties:
> 
> How can one know in which case that it is necessary?


Hey Jean-Christophe,

There's no definitive means to determine this other than experimentation.

I never use “get” unless I get results other than what I think are kosher from 
a command – then I try using a “get”.

--
Take Care,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-02-06 Thread Jean-Christophe Helary


> On Feb 5, 2018, at 11:44, Christopher Stone  
> wrote:
> 
>> I can't seem to directly: 
>> set PREV_SEARCH_STRING to search string of PREV_SEARCH_STRING
> 
> Hey John,
> 
> Under some circumstances you have to expand the property before you can get 
> to the sub-properties:

How can one know in which case that it is necessary?

> tell application "BBEdit"
> set PREV_SEARCH_STRING to search string of (get current search strings)
> end tell
> 

Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune


-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-02-04 Thread Christopher Stone
On 01/21/2018, at 09:56, John Muccigrosso > wrote:
> I can't seem to directly: 

> set PREV_SEARCH_STRING to search string of PREV_SEARCH_STRING


Hey John,

Under some circumstances you have to expand the property before you can get to 
the sub-properties:

tell application "BBEdit"
set PREV_SEARCH_STRING to search string of (get current search strings)
end tell

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-22 Thread Bernardo
Thanks John.
This version works :)

property startAtTop : true
property wrapAround : false
property caseSensitive : false
property matchWords : false
-

tell application "BBEdit"
- set prev search string
set prevSearchString to current search strings
try -- prev search string not always exists
set prevSearchString to search string of prevSearchString
on error
set prevSearchString to ""
end try
 perform search
set theChoice to display dialog "Search current document for:" default 
answer prevSearchString
if button returned of theChoice is "OK" then
set searchOpt to {starting at top:startAtTop, wrap around:wrapAround
, backwards:false, case sensitive:caseSensitive, match words:matchWords}
tell window 1
set findRes to find text returned of theChoice options 
searchOpt with selecting match
if findRes's found is false then beep
--set search string of current search strings to findRes -- 
seems useless
end tell
end if
end tell



-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-22 Thread John Muccigrosso
On Monday, January 22, 2018 at 9:34:40 AM UTC-5, Bernardo wrote:
>
> Thanks for your reply, John.
> Unfortunately, Applescript editor complains about an expected end of line 
> on the word "search" at the first line... I don't know why.
>
>>
>> *set* PREV_SEARCH_STRING *to* current search strings
>>
>>*set* PREV_SEARCH_STRING *to* search string *of* 
>> PREV_SEARCH_STRING
>>
>>
>>
Me either. It could be just a weird copy-paste thing. Try typing it in by 
hand, or maybe it's the more recent version of BBEdit? For that, use 
command-shift-O to open BBEdit's dictionary in the script editor and make 
sure those properties are still there. Meanwhile, this works for me:

*tell* *application* "BBEdit"

   *set* PREV_SEARCH_STRING *to* current search strings

   

   *set* PREV_SEARCH_STRING *to* search string *of* PREV_SEARCH_STRING

   

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

   *tell* *window* 1

   *set* findRes *to* *find* text returned *of* 
theChoice options searchOpt *with* selecting match

   *if* findRes's found *is* *false* *then* *beep*

   *set* search string *of* current search strings *to* 
findRes

   *end* *tell*

   *end* *if*

*end* *tell*


For some reason BBEdit doesn't remember the search string if you change it 
in the dialog.


-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-22 Thread Bernardo
Thanks for your reply, John.
Unfortunately, Applescript editor complains about an expected end of line 
on the word "search" at the first line... I don't know why.

>
> *set* PREV_SEARCH_STRING *to* current search strings
>
>*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
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-21 Thread John Muccigrosso
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
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-20 Thread Bernardo
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
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-19 Thread Bernardo
Don't you think a checkbox for "Start at top" in the Search/Replace dialog 
would be more convenient?
Live Search is great, but it's another kind of Search.


Le jeudi 18 janvier 2018 18:37:36 UTC+1, Rich Siegel a écrit :
>
> On 1/18/18 at 11:49 AM, issa...@gmail.com  (Bernardo) wrote: 
>
> >So, it is no longer possible to seach a documlent directly from its top? 
>
> You can still do so - the "Start at Top" option is gone, but you can: 
>
> - press Command-up-arrow to jump to the beginning of the 
> document before searching; 
>
> - use "Find All" to find all occurrences in the document, and 
> then select the first occurrence in the result list; 
>
> Live Match, and highlighting matches of the selected text will 
> also search the entire document from the beginning. 
>
> R. 
> -- 
> Rich Siegel Bare Bones Software, Inc. 
>   <
> http://www.barebones.com/> 
>
> Someday I'll look back on all this and laugh... until they 
> sedate me. 
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-18 Thread Rich Siegel

On 1/18/18 at 11:49 AM, issarf...@gmail.com (Bernardo) wrote:


So, it is no longer possible to seach a documlent directly from its top?


You can still do so - the "Start at Top" option is gone, but you can:

- press Command-up-arrow to jump to the beginning of the 
document before searching;


- use "Find All" to find all occurrences in the document, and 
then select the first occurrence in the result list;


Live Match, and highlighting matches of the selected text will 
also search the entire document from the beginning.


R.
--
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they 
sedate me.


--
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-18 Thread Bernardo
Concerning start searching at top in the frontmost document, I performed 
this search before my first post but only found users asking the same 
feature.
I just did a new search without finding any workaround, only the "Wrap 
around" option, which is different.
Some users say to look into an option in the Search dialog, but they are 
old posts, with the old modal dialog.

So, it is no longer possible to seach a documlent directly from its top?

Than you.

Le mercredi 17 janvier 2018 14:50:07 UTC+1, Rich Siegel a écrit :
>
> On 1/17/18 at 7:24 AM, issa...@gmail.com  (Bernardo) wrote: 
>
> >I loved to use cmd-F to start searching *from the top* of the 
> >document, wherever insertion point is. With old versions, I remember 
> >this advanced setting could be use: defaults write 
> >com.barebones.bbedit FindDialog:RememberStartAtTop -bool YES but it no 
> >longer seem to work :( 
> > 
> >Modal dialog for search/replace text was also very convenint. There is 
> >no way to have this option again, like in old versions? 
>
> It's a pretty dead issue. If you search the list archives for 
> "start at top" you can see the discussion, which includes 
> workable alternative strategies. (Do note that the option to use 
> the modal dialog went away in BBEdit 10.0.) 
>
> R. 
> -- 
> Rich Siegel Bare Bones Software, Inc. 
>   <
> http://www.barebones.com/> 
>
> Someday I'll look back on all this and laugh... until they 
> sedate me. 
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Search, start at top and other things

2018-01-17 Thread Rich Siegel

On 1/17/18 at 7:24 AM, issarf...@gmail.com (Bernardo) wrote:


I loved to use cmd-F to start searching *from the top* of the
document, wherever insertion point is. With old versions, I remember
this advanced setting could be use: defaults write
com.barebones.bbedit FindDialog:RememberStartAtTop -bool YES but it no
longer seem to work :(

Modal dialog for search/replace text was also very convenint. There is
no way to have this option again, like in old versions?


It's a pretty dead issue. If you search the list archives for 
"start at top" you can see the discussion, which includes 
workable alternative strategies. (Do note that the option to use 
the modal dialog went away in BBEdit 10.0.)


R.
--
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they 
sedate me.


--
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.