Re: AppleScript "Save as..."

2014-11-02 Thread jgill
Thanks Christopher,

I am copying and pasting found text

tell application "BBEdit"
activate
find "" searching in text 1 of text document 
"index.html" options {search mode:grep, starting at top:true, wrap 
around:false, backwards:false, case sensitive:false, match words:false, 
extend selection:false} with selecting match
set theResult to balance tags
set t to the text of selection as string
set t to "" & return & t & ""
set the clipboard to t
end tell
.. and in the second script...

find "(?s) This is the template for monthly sightings.*?Check in WYSIWYG 
mode and save again\\.\\r" searching in text 1 of text document "Month 
2013.htm" options {search mode:grep, starting at top:true, wrap 
around:false, backwards:false, case sensitive:false, match words:false, 
extend selection:false} with selecting match
paste

This works as expected. I realise that I could set a variable to the text 
of the selection but I'm still stuck in my old HyperCard ways ;?)

On Saturday, November 1, 2014 4:56:44 PM UTC, jgill wrote:
>
> I'm using an AppleScript to generate a web page which needs to be saved to 
> a specific local folder. I can't figure out how to access BBEdit's "Save 
> as..." operation. "Save" is covered in the BBEdit Dictionary but not "Save 
> as..."
>

-- 
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.


Re: AppleScript "Save as..."

2014-11-02 Thread Christopher Stone
On Nov 02, 2014, at 03:36, jgill  wrote:
> I am copying and pasting found text

__


Hey Joe,

A good rule of the thumb in automation is to never use the clipboard, unless 
it's the best tool for the job.  It's a common failure-point and/or slow-down.

This is roughly how I'd go about it.

(I've also cleaned up certain aspects of my previous script.)

---
set templateFile to alias ((path to home folder as text) & 
"test_directory:BBEdit_Test_Dir:Template.txt")
set basePath to ((path to documents folder as text) & "(2014):")
tell (current date) to set newFileName to (its month as text) & " " & its year 
& ".html"
set newFilePath to basePath & newFileName

tell application "BBEdit"
  open templateFile
  tell result to save to newFilePath
  
  tell text of text document newFileName
set foundReco to find "" options ¬
  {search mode:grep, starting at top:true, case sensitive:false}

# I'm not seeing any benefit to this line; am I missing something?
# set theResult to balance tags # == FALSE

set replaceText to "" & return & (contents of text of 
found object of foundReco) & ""

# Assuming the newly created document is the target.
replace "(?s) This is the template for monthly sightings.*?Check in WYSIWYG 
mode and save again\\.\\r" using replaceText ¬
  options {search mode:grep, starting at top:true, case sensitive:false}
  end tell
  
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.


Re: AppleScript "Save as..."

2014-11-02 Thread jgill
Christopher, the reason I am using copy and paste is that there are two 
separate (rather complicated) Applescripts involved here. One which selects 
text from one page and another that inserts that text into a placeholder. 
Short of using an intermediate window, I can't think of any way to transfer 
over 1000 lines of HTML from one window to another across scripts. I 
haven't tried to do it all in a single script because of timing issues. 
Using 'Balance Tags' seems to be a good way to select the contents of an 
entire div (with lots of nested divs). 

Thanks again for your help. Joe




On Saturday, November 1, 2014 4:56:44 PM UTC, jgill wrote:
>
> I'm using an AppleScript to generate a web page which needs to be saved to 
> a specific local folder. I can't figure out how to access BBEdit's "Save 
> as..." operation. "Save" is covered in the BBEdit Dictionary but not "Save 
> as..."
>

-- 
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.


Re: AppleScript "Save as..."

2014-11-02 Thread Christopher Stone
On Nov 02, 2014, at 07:59, jgill  wrote:
> Christopher, the reason I am using copy and paste is that there are two 
> separate (rather complicated) Applescripts involved here. One which selects 
> text from one page and another that inserts that text into a placeholder.
__

Hey Joe,

Without seeing the actual process I can't speculate too much, but in general 
it's quite easy to work between two windows in one script.

--
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.


Where is the "Mark submenu"?

2014-11-02 Thread Vlad Ghitulescu
Hello!


I'm reading in the BBEdit User Manual (11.0).pdf about "Using Grep to Set 
Markers": 

"(…) Choose the Find & Mark All command from the Mark submenu. (…)"

But I cannot find this Mark submenu.

Could anybody tell me where it is please?!
Thanks!


Regards,
Vlad

-- 
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.


Re: AppleScript "Save as..."

2014-11-02 Thread jgill
Hi Cristopher, I managed to do it with one script. The timing issues I had 
with my old MacPro are not there with my new iMac. It's much faster.

Can I ask how you manage to insert colour-coded scripts into this forum?

Thanks, Joe



On Saturday, November 1, 2014 4:56:44 PM UTC, jgill wrote:
>
> I'm using an AppleScript to generate a web page which needs to be saved to 
> a specific local folder. I can't figure out how to access BBEdit's "Save 
> as..." operation. "Save" is covered in the BBEdit Dictionary but not "Save 
> as..."
>

-- 
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.


Re: Where is the "Mark submenu"?

2014-11-02 Thread Christopher Stone
On Nov 02, 2014, at 12:15, Vlad Ghitulescu  
wrote:
> I'm reading in the BBEdit User Manual (11.0).pdf about "Using Grep to Set 
> Markers": 
__

Hey Vlad,

Here ya go.



--
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.


Re: AppleScript "Save as..."

2014-11-02 Thread Christopher Stone
On Nov 02, 2014, at 13:11, jgill  wrote:
> I managed to do it with one script.
__

Hey Joe,

Very good.

> Can I ask how you manage to insert colour-coded scripts into this forum?


I copy them from Script Debugger (after compiling) and paste them into Mail 
(the Applescript Editor works similarly).

Any source of styled-text should do.

You can post styled-text from Gmail, and I'm fairly sure you can from the 
BBEdit Google-Groups page as well.

If you're dealing with a shell script or other programming language in BBEdit 
you can use the 'Copy as Styled Text' item in BBEdit's Edit Menu.

--
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.


Re: Where is the "Mark submenu"?

2014-11-02 Thread Vlad Ghitulescu
Thanks, Chris!
It looks like there is no more context menu for all of this (such as Clear 
Markers or Find and Mark all…), right?


Am Sonntag, 2. November 2014 20:41:57 UTC+1 schrieb Christopher Stone:
>
> On Nov 02, 2014, at 12:15, Vlad Ghitulescu  > wrote:
>
> I'm reading in the BBEdit User Manual (11.0).pdf about "Using Grep to Set 
> Markers": 
>
> __
>
> Hey Vlad,
>
> Here ya go.
>
>
> --
> 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.


BBEdit 11 crashes while switching color scheme

2014-11-02 Thread Vlad Ghitulescu
Hello!


I managed to bring BBEdit 11 to crash :-( by switching from the *BBEdit 
Classic" - Color Scheme to the current "Solarized - Light" 
(http://ethanschoonover.com/solarized). 
It isn't only the Solarized - theme, but all of my old Color Schemes (s. 
attached screenshot), that bring BBEdit to crash.

Does anybody experience something like this too?

Do the old color schemes must be converted somehow in order to be 
compatible to BBEdit 11?

Thanks!


Regards,
Vlad

-- 
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.


Re: BBEdit 11 crashes while switching color scheme

2014-11-02 Thread Rich Siegel
On Sunday, November 2, 2014, Vlad Ghitulescu 
 wrote:


I managed to bring BBEdit 11 to crash :-( by switching from the 
*BBEdit Classic" - Color Scheme to the current "Solarized - 
Light" (http://ethanschoonover.com/solarized).




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.


Re: Django Language Module

2014-11-02 Thread Lee Hinde
I'm not aware of any, but I haven't looked in a year or two..

On Sat, Nov 1, 2014 at 9:11 AM, Dan Ross  wrote:

> Hi François -
>
> Sorry. I meant the templating language.
>
> I've been working on one, but I wanted to make sure I'm not repeating work
> that's already been done.
>
> On Saturday, November 1, 2014 7:58:32 AM UTC-5, François Schiettecatte
> wrote:
>>
>> Dan
>>
>> Not sure what you mean by a Django language module. Django is a web
>> framework written in Python, did you meant that ? Or the templating
>> language it uses ?
>>
>> If you want Django language help, you might want to look at Dash  at
>> http://kapeli.com/dash , it has a Django docset.
>>
>> François
>>
>> > On Oct 31, 2014, at 9:16 PM, Dan Ross  wrote:
>> >
>> > Hi folks-
>> >
>> > I've been searching around for any Django language modules for BBEdit
>> without any success. Does anyone know of any?
>> >
>>
>

-- 
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.