Re: Help with Perl Filter to increment an element

2014-11-01 Thread Marek Stepanek
On 02/11/14 02:03, Charlie Garrison wrote:
> Good morning,
> 
> On 1/11/14 at 12:49 PM +0100, Marek Stepanek
>  wrote:
> 
>> But how to align  the last 10. Takt with sprintf()?
> 
> I don't recall specifics, but I'm pretty sure dash character will right
> align, so something like this:
> 
> sprintf("%-30.10s",$increment)
> 
> I doubt that is actually correct, maybe dash needs to go before the 's'.
> Anyway, there is some way to right align the string using sprintf, check
> perldoc.
> 
> 
> Charlie
> 

Thank you Charlie!

I found meanwhile following solution. Probably too complicate approach,
but working nicely:

#!/usr/bin/perl

use warnings;
use strict;

my $increment = 0;

while () {
if (/\s*\d+\.\sTakt/) {
next if /^\s+$/;
++$increment;
s/^([^%]+)(%)\s*\d+\.\sTakt$/sprintf("%-33s %s %20s .
Takt",$1,$2,$increment)/eg; 
}
print;
}

__DATA__

\NOtes\qu{ABCD}\enotes\barre %   6. Takt
\NOtes\qu{EFGH}\enotes\barre %   7. Takt
\NOtes\ql{IJKL}\enotes\barre %   8. Takt
\NOtes\ql{MNOP}\enotes\barre %   9. Takt
\NOtes\ql{QRST}\enotes\barre %  10. Takt
\setclef1{\treble}\changeclefs%
\NOtes\qu{abcd}\enotes\barre %   1. Takt
\NOtes\qu{efgh}\enotes\barre %   2. Takt
\NOtes\ql{ijkl}\enotes\barre %   3. Takt
\NOtes\ql{mnop}\enotes\barre %   4. Takt
\NOtes\sk\ql{qrst}\enotes\barre %5. Takt




-- 
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-01 Thread Christopher Stone
On Nov 01, 2014, at 17:57, jgill  wrote:
> So, it is a previously saved file but is being modified and saved to a 
> different location. It will not be replacing the original template.

__

Hey Joe,

Okay.  Something like this should work.

---
set _template 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)
  set _month to its month as text
  set _year to its year
end tell
set newFileName to _month & " " & _year & ".html"
set newFilePath to basePath & newFileName

tell application "BBEdit"
  set newDoc to open _template
  tell newDoc to save to newFilePath
  tell document newFileName
# Do your edits.
# Save.
  end tell
end tell
---

Are you actually pasting into the newly opened template?  If so there's 
probably a better way.

--
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: Help with Perl Filter to increment an element

2014-11-01 Thread Charlie Garrison

Good morning,

On 1/11/14 at 12:49 PM +0100, Marek Stepanek 
 wrote:



But how to align  the last 10. Takt with sprintf()?


I don't recall specifics, but I'm pretty sure dash character 
will right align, so something like this:


sprintf("%-30.10s",$increment)

I doubt that is actually correct, maybe dash needs to go before 
the 's'. Anyway, there is some way to right align the string 
using sprintf, check perldoc.



Charlie

--
   Charlie Garrison  
   github.com/cngarrison   metacpan.org/author/CNG

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

--
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-01 Thread jgill
Thank you Christopher,

The files is a template file which I modify with AppleScript. It has a 
default name "Month Year.html". The AppleScript opens it, does a paste 
operation, and changes a few lines of text. I then want to save the 
modified files into another folder (2014) as, for instance "November 
2014.html".  This changes from month to month appropriately. I could hard 
code the save path or generate it using the date object.

So, it is a previously saved file but is being modified and saved to a 
different location. It will not be replacing the original template.

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: auto-pairing brackets?

2014-11-01 Thread Vlad Ghitulescu
Yes, it does, every single time, even after explicitly allowing it! :-(
The workaround I've found is using TextExpannder-Snippets only for BBEdit ( 
expands to () and puts the cursor in the middle etc.). It has a little lag 
but it works…
Why doesn't BBEdit has this after all this years? :-)

Am Samstag, 1. November 2014 02:12:38 UTC+1 schrieb Ron Fleckner:
>
> Sorry I can’t really help you.  I’ve had AutoPairs for some years and it’s 
> always just worked with new computers and system software updates and new 
> versions of OS X. 
>
> I’ve just looked at Privacy>Accessibility in sys prefs and AutoPairs isn’t 
> even there. 
>
> Does AutoPairs actually ask to have special privileges like Keyboard 
> Maestro? 
>
> Ron 
>
> > On 31 Oct 2014, at 4:29 pm, Vlad Ghitulescu  > wrote: 
> > 
> > Thanks! At least I haven't missed any setting in the preferences ;-) 
> > 
> > I've downloaded AutoPairs and - from the description - it seem to enable 
> everything I want, but… I couldn't activate the Universal Access for it! It 
> looks like a bug that affects 10.10 (two big kisses ;-), Witch and Keyboard 
> Maestro have also the problem, although I was able to activate them by 
> dragging them onto the Universal Access pane. Unfortunately I couldn't find 
> AutoPairs in ~/Library/PreferencePanes 
> > 
> > Any idea? 
> > 
> > 
> > Thanks again! 
> > Vlad 
> > 
> > Am Freitag, 31. Oktober 2014 03:56:30 UTC+1 schrieb Ron Fleckner: 
> > 
> > > On 31 Oct 2014, at 10:35 am, Maarten Sneep  
> wrote: 
> > > 
> > > 
> > >> On 31 Oct 2014, at 24:29, Ron Fleckner  
> wrote: 
> > >> 
> > >> Try out AutoPairs, a System Preferences prefPane.  Very good and 
> still works on 10.10.10 
> > >>  
> > > 
> > > Are we already at version XXX? 
> > > 
> > > Maarten 
> > > 
> > > — 
> > 
> > That would be 30.  Or three big kisses! 
> > 
> > 
> > 
> > -- 
> > This is the BBEdit Talk public discussion group. If you have a 
> > feature request or would like to report a problem, please email 
> > "sup...@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+un...@googlegroups.com . 
> > To post to this group, send email to bbe...@googlegroups.com 
> . 
>
>

-- 
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-01 Thread Christopher Stone
On Nov 01, 2014, at 11:56, 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.
__

Hey Joe,

There's not a save-as command per se.

Are you saving an unsaved document?

Are you saving a previously saved document to a new location?

What exactly are you doing?

An unsaved document is easy to handle:

--
set destFolderPath to path to downloads folder as text # HFS path.
set newFileName to "A Test File.html"
set savePath to destFolderPath & newFileName

tell application "BBEdit"
  tell front text document
save to savePath
  end tell
end tell
--

If you're dealing with a previously saved file then the story is a bit 
different.  Handling that improperly can cause you to lose data in the original 
file if it's unsaved.

Here's one way to deal with that:

--
set destFolderPath to POSIX path of (path to downloads folder as text)
set newFileName to "A Test File.html"
set savePath to quoted form of (destFolderPath & newFileName)

tell application "BBEdit"
  tell front text document
if on disk = true then
  if modified of its window = true then
save
  end if
  set _file to quoted form of (POSIX path of (get its file))
  tell AppleScript
do shell script "cp " & _file & " " & savePath
  end tell
end if
  end tell
end tell
--

I've used the shell, since I can copy and rename the file in one operation.

If I wanted to be safer I could copy the file with the Finder and then rename 
it.  The Finder will balk if there is an existing file.

Or I could deliberately check to see if there's going to be a collision and 
throw an error.

Or I could duplicate the document in BBEdit and use the first method to save it.

It really depends upon what you need to be done.

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


Swift

2014-11-01 Thread CompilerGuru
Has anyone out there used BBedit as a editor for Swift programming or 
parallel Swift programming?

-- 
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-01 Thread Dan Ross
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 
> > "sup...@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+un...@googlegroups.com . 
> > To post to this group, send email to bbe...@googlegroups.com 
> . 
>
>

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


AppleScript "Save as..."

2014-11-01 Thread jgill
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: Django Language Module

2014-11-01 Thread François Schiettecatte
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.

-- 
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: Help with Perl Filter to increment an element

2014-11-01 Thread Marek Stepanek
On 01/11/14 10:59, Marek Stepanek wrote:
> 
> 
> Hello all!
> 
> 
> I try to transform this LaTeX (MusiXTEX) snipped ...

Sorry! I found it: a point was missing:

... sprintf("%30.10s",$increment) ->.<- ". Takt"/eg;

But how to align  the last 10. Takt with sprintf()?

But I will certainly find out myself very soon.


Happy Halloween to all


marek

#!/usr/bin/perl

use warnings;
use strict;

my $increment = 0;

while () {
if (/\s*\d+\.\sTakt/) {
next if /^\s+$/;
# chomp;
++$increment;
# $increment=sprintf("%40.10s",$increment);
s/^([^%]+)%\s*\d+\.\sTakt$/"$1 %" .  
sprintf("%30.10s",$increment) .
". Takt"/eg;
}
print;
}

__DATA__

\NOtes\qu{ABCD}\enotes\barre %   6. Takt
\NOtes\qu{EFGH}\enotes\barre %   7. Takt
\NOtes\ql{IJKL}\enotes\barre %   8. Takt
\NOtes\ql{MNOP}\enotes\barre %   9. Takt
\NOtes\ql{QRST}\enotes\barre %  10. Takt
\setclef1{\treble}\changeclefs%
\NOtes\qu{abcd}\enotes\barre %   1. Takt
\NOtes\qu{efgh}\enotes\barre %   2. Takt
\NOtes\ql{ijkl}\enotes\barre %   3. Takt
\NOtes\ql{mnop}\enotes\barre %   4. Takt
\NOtes\sk\ql{qrst}\enotes\barre %5. Takt

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


Help with Perl Filter to increment an element

2014-11-01 Thread Marek Stepanek


Hello all!


I try to transform this LaTeX (MusiXTEX) snipped

from


\NOtes\qu{ABCD}\enotes\barre %   6. Takt
\NOtes\qu{EFGH}\enotes\barre %   7. Takt
\NOtes\ql{IJKL}\enotes\barre %   8. Takt
\NOtes\ql{MNOP}\enotes\barre %   9. Takt
\NOtes\ql{QRST}\enotes\barre %  10. Takt
\setclef1{\treble}\changeclefs%
\NOtes\qu{abcd}\enotes\barre %   1. Takt
\NOtes\qu{efgh}\enotes\barre %   2. Takt
\NOtes\ql{ijkl}\enotes\barre %   3. Takt
\NOtes\ql{mnop}\enotes\barre %   4. Takt
\NOtes\sk\ql{qrst}\enotes\barre %5. Takt

to

\NOtes\qu{ABCD}\enotes\barre %1. Takt
\NOtes\qu{EFGH}\enotes\barre %2. Takt
\NOtes\ql{IJKL}\enotes\barre %3. Takt
\NOtes\ql{MNOP}\enotes\barre %4. Takt
\NOtes\ql{QRST}\enotes\barre %5. Takt
\setclef1{\treble}\changeclefs%
\NOtes\qu{abcd}\enotes\barre %6. Takt
\NOtes\qu{efgh}\enotes\barre %7. Takt
\NOtes\ql{ijkl}\enotes\barre %8. Takt
\NOtes\ql{mnop}\enotes\barre %9. Takt
\NOtes\sk\ql{qrst}\enotes\barre %10. Takt


Could someone be so kind, to help me out? There is a certainly a silly
syntax error in the following perl script (mind the line feeds of my
mail client):


#!/usr/bin/perl

use warnings;
use strict;

my $increment = 0;

while () {
if (/\s*\d+\.\sTakt/) {
next if /^\s+$/;
++$increment;
s/^([^%]+)%\s*\d+\.\sTakt$/"$1 %" .  
sprintf("%30.10s",$increment)
". Takt"/eg;
}
print;
}

__DATA__

\NOtes\qu{ABCD}\enotes\barre %   6. Takt
\NOtes\qu{EFGH}\enotes\barre %   7. Takt
\NOtes\ql{IJKL}\enotes\barre %   8. Takt
\NOtes\ql{MNOP}\enotes\barre %   9. Takt
\NOtes\ql{QRST}\enotes\barre %  10. Takt
\setclef1{\treble}\changeclefs%
\NOtes\qu{abcd}\enotes\barre %   1. Takt
\NOtes\qu{efgh}\enotes\barre %   2. Takt
\NOtes\ql{ijkl}\enotes\barre %   3. Takt
\NOtes\ql{mnop}\enotes\barre %   4. Takt
\NOtes\sk\ql{qrst}\enotes\barre %5. Takt

-- 
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: Eek! Monaco jaggies.

2014-11-01 Thread Darrel E. Knutson

There's a new 'ProFontX' available at. I 
like it, YMMV.

Yes, but it is missing too many characters anymore. For example, it lacks a € 
symbol.


I just tried it and the euro symbol is in fact present in ProFontX.

Darrel

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