Automation question

2019-09-20 Thread Christian Boyce
I have a BBEdit document looking something like this:

{Tag_A}
Some text, could be multiple sentences, multiple paragraphs.
{/Tag_A}

Some other text here

{Tag_B}
More text here. Could be multiple sentences, multiple paragraphs, as above.
{/Tag_B}

{Tag_A}
Some text, could be multiple sentences, multiple paragraphs.
{/Tag_A}

Some other text here

{Tag_B}
More text here. Could be multiple sentences, multiple paragraphs, as above.
{/Tag_B}

Etc.

I have two AppleScripts which currently work on whatever text it selected. For 
purposes of this discussion let's say I have Script A which applies some custom 
capitalization, and Script B that wraps certain words in  
tags. 

The scripts work great as long as I select, by hand, the text I want to work 
with. At the end of the script, after I have done the operations I want to do, 
I set the selection to the newly computed text. 

The way it SEEMS to work is the selected text stays selected the whole time, 
and at the very end I am writing into the selection. It is as if I pasted a 
result into a selection— the selected text is replaced with what I pasted.

What I'm trying to do is automate the selections. That is, in the example 
above, I want to (somehow) automatically select everything between the first 
set of {Tag_A}{/Tag_A} tags, and run Script A on it. Then I want to (somehow) 
automatically select everything between the first {Tag_B}{/Tag_B} tags, and run 
Script B. Then I want to select the text between the next set of A tags and run 
Script A, and then select the text between the next set of B tags and run 
Script B, and so on.

Any suggestions? What I'm describing is sort of an invisible hand that makes 
the selections for me. There might be a better way to do it so I am open to 
suggestions!

I don't have any trouble with the Scripts A and B. Those are fine. What I need 
is a way to tell BBEdit to select the right chunks of text to apply these 
scripts to.

THANK YOU—

Christian Boyce

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/2C08A6D3-BA5F-41B8-A8DF-3ED3DF64E66C%40christianboyce.com.


Pipe list of files into new bbprojectd

2019-09-20 Thread Charlie Garrison

Good evening,

I've got a custom grep/ls script which outputs a list of matching files, 
which I want to use as contents of a new project. The list is quite long 
(too long to pass as command args), so using `bbedit --project` won't 
work. Is there some other way to pipe a list of file paths to `bbedit` 
so they become items in the project?


What I really want is a way to Multi-File Search all the files. I can do 
it using `bbfind` but I prefer something within BBEdit UI. So I thought 
about creating a project with all the files, and I can use that as 
'search in' target in search dialog.


The count of files to search is over 10,000.
Using `bbedit --project` prints error `-bash: /usr/local/bin/bbedit: 
Argument list too long`


-cng

--

Charlie Garrison   
Garrison Computer Services  
PO Box 380
Tumbarumba NSW 2653  Australia

--
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/27081BA3-52CE-474B-9943-E963F4769AD5%40garrison.com.au.