Some placeholders broken in 10.5.1?

2013-01-16 Thread MST3K
Hi,
I just updated my sites to find that some of the (important) placeholders 
I've been using for years seem to be broken.  Where they exist in the 
document, they are updated with no data (actually, a dozen or so spaces), 
so that the placeholder is gone, but the data is blank.  This seems to be 
happening on some placeholders and not others-- For example, I have the 
problem with #DOCTITLE# and #DOCSIZE#, but not with #COMPDATE#.  I tried a 
couple of different unrelated sites (even the BBEdit "very simple page" 
template), with the same behavior for those placeholders.  Anyone able to 
replicate this or no?

Thanks,
Brian 

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: 





[ANN] BBEdit 10.5.2 (3255) pre-release

2013-01-16 Thread Rich Siegel

Good { morning, afternoon, evening },

We're working on an update to BBEdit 10.5 to address a few 
recently reported issues. In addition to the changes noted 
below, this build incorporates changes from previous 10.5.1 
pre-release builds.


Note that this is a _pre-release_ version. The intent is to fix 
bugs and address areas of improvement based on what our 
customers have reported. However, since the software is at this 
point not fully tested, there _may_ be bugs and regressions. If 
this prospect makes you nervous, then sticking with the public 
release versions is your best course of action. Nobody will be 
offended if you choose to do so; you're under no obligation to 
install and use anything but a public release. :-)


Following is a summary of the changes in the software since the 
previous build. The change notes are organized into additions, 
changes, and fixes, and are annotated where appropriate with 
case numbers. So if you recognize a number corresponding to a 
support case that was opened for you, you can now verify that 
it's been fixed correctly. Please take the time to review the 
changes before using the new build -- there are a lot of them, 
and it'll be worth your time.


One final note: If you run into a bug in a pre-release version, 
PLEASE DO NOT REPORT THE BUG TO THE LIST. This includes asking 
about whether others have seen the same problem. Instead, please 
send a bug report to  and we will deal 
with it there. This will help us keep the list discussion on 
topic and productive for all list members.




version 10.5.2 (3255)   (01/16/2013)

Additions
-

o   (none in this build)

Changes
---

o   (none in this build)

Fixes
-

*   Made a change so that the "Restoring [BBEdit] state" panel at
startup shows the name of each document as it's opened, and also
gives various timer services a chance to run.

*   [257288, 257444] Fixed a collection of bugs in the Functions,
Jump Points, and Markers palettes that would cause them to
inappropriately change the selection range when making a document
active, as well as unexpectedly lose their contents when closing
an unrelated floating window.

*   Fixed incorrect number formatting in the Functions floater.

*   Fixed a bug in which "Sort Lines" did not release memory 
that it

allocated during the operation.

*   [257530] Worked around apparent bug on 10.6 which would cause
the application to crash in the guts of QuickLook when 
doing a

"Close All Documents". Unfortunately the solution involves
disabling QuickLook support entirely when running on 10.6; if
this is important to you, consider upgrading your OS to 
10.7 (or

10.8, if your hardware supports it).

*   Fixed bug in which the "Restoring BBEdit State" panel would
remain on screen longer than was necessary (and in some
situations would never go away).

*   [257673] Fixed bug in which the drag image when dragging text
was not correct when the selection didn't begin at the beginning
of a line. (The correct text was dragged in any event.)

*   [219459] Fixed bug in which using "Save a Copy" would 
trigger a

sequence of events which could end in data loss if the wrong
choices were made.

*   Fixed bug in which callouts (`MARK`, `FIXME`, etc) were not
recognized when used in `#` comments in PHP.

*   Updated a code path in the "Open File by Name" search mechanics
to use NSOpenPanel when asking for a new search directory.

*   [258116] Corrected a math error which eliminated the dead space
between the line bar (or gutter) and the left edge of the text,
causing misalignment when the editing view was split, and also
making it impossible to do single-click line selection.

*   [258112] Increased the maximum allowed length for element names,
so that folding in XML documents works with element names that
were longer than the old limit (which was perfectly reasonable
since 1995, but there you go).

*   [258095] Worked around a performance problem in the system
foundation classes which would cause undesired delays when
editing in very large syntax-colored documents.

*   The minimum OS requirement has been changed to 10.6.8 (for both
BBEdit and TextWrangler); there's no particular reason not to
update, and on the contrary some very good reasons to do so.

*   [257782] The application now uses `NSOpenPanel` and
`NSSavePanel` for presenting file choosers (including the Open
dialog) and "Save As" dialogs, rather than the legacy Navigation
Services interfaces. This should resolve problems with accessory
controls not working correctly on Retina machines, and perhaps
may cure other lurking horrors in the Navigation Services APIs.

*   Fixed bug in which clicking on the application's icon in the
Dock would not un-minimize the front window when it should have,
unl

Help getting an AppleScript to run as a text filter

2013-01-16 Thread Adam Engst
Hi folks,

I have modified a found AppleScript to number the lazylinks in a Markdown 
file. Lazylinks are something we created for [TidBITS][*] that enables us 
to identify every link with an asterisk, and then associate the source text 
and destination URL via the order they appear. It's much easier for 
writing, since all source text references are the same, and then you just 
list out the destination URLs underneath the paragraph. But every now and 
then I need to number the links for compatibility with a system that 
doesn't understand lazylinks, such as [Leanpub][*]. (This paragraph is an 
example of lazylinks - the two links should be numbered 1 and 2.)

[*]: http://tidbits.com/
[*]: https://leanpub.com/

The problem is that the AppleScript works fine when run from AppleScript 
Editor, but throws an error when run as a text filter from within BBEdit. 
I've looked at the BBEdit manual, but honestly, since I know only enough 
about AppleScript to tweak scripts, I haven't the foggiest idea how to use 
a RunFromBBEdit handler. Any suggestions on how to fix this script so I can 
embed it in a text factory? Thanks!

(Text below, and here's a Dropbox link, if that's easier - not sure of the 
convention here.)

https://dl.dropbox.com/u/574336/Number%20Markdown%20%2A%20Links.scpt

cheers... -Adam


*set* linkRef *to* "]\\[\\*\\]"

*set* linkDest *to* "\\[\\*\\]\\:"

*set* _cntr *to* 0

*tell* *application* "BBEdit"

*tell* *text* *of* *text document* 1

*select* *insertion point* *before* *character* 1

*repeat*

*set* refFnd *to* *find* linkRef options {search mode:grep, case sensitive:
false}

*if* (found *of* refFnd) = true *then*

*set* _cntr *to* _cntr + 1

*tell* (*a reference* *to* found object *of* refFnd)

*set* *its* *text* *to* "][" & _cntr & "]"

*end* *tell*

*set* deskFnd *to* *find* linkDest options {search mode:grep, case sensitive
:false}

*if* (found *of* deskFnd) = true *then*

*tell* (*a reference* *to* found object *of* deskFnd)

*set* *its* *text* *to* "[" & _cntr & "]:"

*end* *tell*

*select* *insertion point* *before* *character* 1

*else*

*beep*

*end* *if*

*else*

*exit* *repeat*

*end* *if*

*end* *repeat*

*select* *insertion point* *after* *character* -1

*end* *tell*

*end* *tell*

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: 





Re: Help getting an AppleScript to run as a text filter

2013-01-16 Thread Rich Siegel

On Wednesday, January 16, 2013, Adam Engst  wrote:

The problem is that the AppleScript works fine when run from 
AppleScript Editor, but throws an error when run as a text 
filter from within BBEdit. [...] Any suggestions on how to fix 
this script so I can embed it in a text factory? Thanks!


Wait. Text *filter*, or text *factory*?

It's an important difference because while there's a little bit 
of flexibility in how text *filter* scripts may be called, a 
text *factory* script must conform to a specific calling 
convention (because of the runtime requirements of text factories).


If you can clear that up, I bet someone can give you an informed 
and accurate answer. :-)


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

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


--
--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: 





Re: Help getting an AppleScript to run as a text filter

2013-01-16 Thread John Delacour

On 16/01/2013 17:32, Adam Engst wrote:

(This paragraph is an example of lazylinks - the two links should be 
numbered 1 and 2.)


[*]: http://tidbits.com/
[*]: https://leanpub.com/


Adam,

I’m afraid I find AppleScript impossibly verbose for this kind of simple 
text munging.  I don’t know what your docs look like but, supposing each 
link is on a separate line, then the Perl script below, saved as a text 
filter, will change all the asterisks to the appropriate number.  If 
not, then the script can almost certainly be modified to do the job, 
however the doc is laid out.  This script presumes that the docs have 
UNIX line endings.  If they don’t then again it can easily be modified.  
If you post a snippet from a typical doc then it will only take a few 
moments to write a working filter



#!/usr/bin/perl
while (<>) {
if (m~http://tidbits~) { s~\[\*\]~[1]~ }
if (m~https://leanpub~) { s~\[\*\]~[2]~ }
print;
}

JD




--
--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: 





Re: [ANN] BBEdit 10.5.2 (3255) pre-release

2013-01-16 Thread Patrick Woolsey
Good evening folks,

Sorry for the typo and here's the correct download link for this build:


  version 10.5.2 (3255)   (01/16/2013)

  [ NB: please see Rich's prior post for release notes ]

  This package can be downloaded from our web server:





Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc. 

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: 





Re: Help getting an AppleScript to run as a text filter

2013-01-16 Thread Christopher Stone
Hey Adam,

Hmm.  That script doesn't work for me.  [I believe I've figured it out.]

Your script runs fine from BBEdit's script menu.

  ~/Library/Application Support/BBEdit/Scripts/Number Markdown * Links.scpt

On Jan 16, 2013, at 11:32, Adam Engst  wrote:
> But every now and then I need to number the links for compatibility with a 
> system that doesn't understand lazylinks, such as [Leanpub][*]. (This 
> paragraph is an example of lazylinks - the two links should be numbered 1 and 
> 2.)

Okay.  I think I figured it out:

You're trying to link unenumerated markers in article text to their associated 
footnoted URLs (again unenumerated)?  (This wasn't completely clear from the 
example you posted - to me at least.)

---
Input:
---

A TidBITS Reference in the article body [*]
A LeanPub Reference in the article body [*]
...

[*]: http://tidbits.com/
[*]: https://leanpub.com/

---
Output:
---

A TidBITS Reference in the article body ][1]
A LeanPub Reference in the article body ][2]
...

[1]: http://tidbits.com/
[2]: https://leanpub.com/

> The problem is that the AppleScript works fine when run from AppleScript 
> Editor, but throws an error when run as a text filter from within BBEdit.

Applescripts run from the script menu.  They do not run as 'Text Filters', and 
their utility is constrained when run as an 'Applescript Filter' from within a 
'Text Factory' to INPUT-->OUTPUT — so you cannot process piecemeal as you're 
doing in the script — you must instead generate the entire output.

  on ApplyTextTransform (fileData)
  -- do something to fileData
  return fileData -- or some reasonable facsimile thereof
  end

The only reason to add an Applescript to a Text Factory is if you need 
capabilities in the TF that aren't available directly to Applescript.  Is that 
true in your use-case?

If you really need to do this I can probably help.

It looks like JD missed the boat with his Perl script, but I'm sure he can fix 
it in a trice.  It certainly would be more efficient than using Applescript to 
iterate through the ref-links in BBEdit.

If I was going to use Applescript I'd probably use the Satimage.osax to provide 
more options.  For instance I would do some basic error-checking and make 
certain the number of references and their targets matched up.

This basically emulates what you've done in BBEdit, but it's faster.  (Tested 
with 50 ref-links.)

---

try
  
  tell application "BBEdit" to set _text to text of front text window
  
  set refList to find text "\\[\\*\\]([^:]|$)" in _text with regexp, all 
occurrences and string result
  set targetList to find text "\\[\\*\\]:" in _text with regexp, all 
occurrences and string result
  
  if length of refList ≠ length of targetList then
error "The number of references and links are unequal."
  else
repeat with i from 1 to length of refList
  set {sPos, _len} to {matchPos, matchLen} of (find text 
"\\[\\*\\]([^:]|$)" in _text with regexp)
  set _text to change "\\[\\*\\]" into "][" & i & "]" in _text starting at 
sPos for _len with regexp
  set {sPos, _len} to {matchPos, matchLen} of (find text "\\[\\*\\]:" in 
_text with regexp)
  set _text to change "\\*" into (i as text) in _text starting at sPos for 
_len with regexp
  
end repeat

tell application "BBEdit" to set text of front text window to _text

  end if
  
on error e number n
  set e to e & return & return & "Num: " & n
  tell me to set dDlg to display dialog e with title "ERROR!" buttons 
{"Cancel", "Copy", "OK"} default button "OK"
  if button returned of dDlg = "Copy" then set the clipboard to e
  
end try

---

--
Take Care,
Chris

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: 





Re: 258536 Right clicking plays a beep

2013-01-16 Thread G. T. Stresen-Reuter
On Jan 16, 2013, at 3:07 PM, Rich Siegel wrote:

> *   [258536] Fixed bug in which right-clicking in a document that
>was HTML or XML but not properly formed would play a beep.

Just out of curiosity (haven't downloaded yet), what's it play now that it's 
fixed, 8 bars from Freebird? ;-)

JK, thanks for all the wonderful fixes. Going to get my crispy new copy right 
now!

Ted

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

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: