AppleScript syntax colouring? How?

97 views
Skip to first unread message

Martin Petersen

unread,
Jun 12, 2018, 7:35:05 AM6/12/18
to BBEdit Talk
Played around with the Demo and I must say I am impressed by the support for Regular Expressions in the find and replace dialogue. Yet I can not find support (syntax coloring) for AppleScripts. Neither is a .scpt file automatically recognized nor can I find AppleScript in the language scopes at the bottom of the window. I am sure I do something wrong but what?

Jean-Christophe Helary

unread,
Jun 12, 2018, 7:49:55 AM6/12/18
to bbe...@googlegroups.com

On Jun 12, 2018, at 14:41, 'Martin Petersen' via BBEdit Talk <bbe...@googlegroups.com> wrote:

Played around with the Demo and I must say I am impressed by the support for Regular Expressions in the find and replace dialogue. Yet I can not find support (syntax coloring) for AppleScripts. Neither is a .scpt file automatically recognized nor can I find AppleScript in the language scopes at the bottom of the window. I am sure I do something wrong but what?

A .scpt file is a compiled applescript. You need at least Script Editor to open and edit it.

BBEdit works with .applescript files, which are non compiled applescript documents.


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


Martin Petersen

unread,
Jun 12, 2018, 12:22:42 PM6/12/18
to BBEdit Talk
Thanks, but still no syntax colouring. Any idea?

Patrick Woolsey

unread,
Jun 12, 2018, 12:33:27 PM6/12/18
to bbe...@googlegroups.com
On 6/12/18 at 12:21 PM, bbe...@googlegroups.com ('Martin
Petersen' via BBEdit Talk) wrote:

>Thanks, but still no syntax colouring. Any idea?
>

The short answer :-) is that BBEdit does not offer syntax
coloring for AppleScript due to various technical & practical considerations.

Instead, we suggest you use the AppleScript Editor -- or if your
scripting needs are more extensive, we highly recommend Script
Debugger (and use it ourselves).


Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com/>


Harvey Pikelberger

unread,
Jun 12, 2018, 2:09:46 PM6/12/18
to BBEdit Talk
When it comes to AppleScript consider JXA (JavaScript for Automation in macOS) -- in other words do AppleScript but with JavaScript, at which point you can take advantage of BBEdit's syntax coloring.  Also integrates with Node/NPM.

Jean-Christophe Helary

unread,
Jun 12, 2018, 6:22:14 PM6/12/18
to bbe...@googlegroups.com

On Jun 13, 2018, at 1:21, 'Martin Petersen' via BBEdit Talk <bbe...@googlegroups.com> wrote:

Thanks, but still no syntax colouring. Any idea?

That's probably something I added later on...

Jean-Christophe 

--
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: <http://www.twitter.com/bbedit>
---
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.
Visit this group at https://groups.google.com/group/bbedit.

Martin Petersen

unread,
Jun 12, 2018, 9:10:26 PM6/12/18
to BBEdit Talk
Thank you.

Christopher Stone

unread,
Jun 23, 2018, 12:28:26 PM6/23/18
to BBEdit-Talk
On 06/12/2018, at 00:41, 'Martin Petersen' via BBEdit Talk <bbe...@googlegroups.com> wrote:
Played around with the Demo and I must say I am impressed by the support for Regular Expressions in the find and replace dialogue. Yet I can not find support (syntax coloring) for AppleScripts.


Hey Martin,

See this page.


The modules available won't have as comprehensive coloring as the Script Editor or Script Debugger, but they're better than nothing.

--
Best Regards,
Chris

Jean-Christophe Helary

unread,
Jun 23, 2018, 9:50:43 PM6/23/18
to bbe...@googlegroups.com
On Jun 24, 2018, at 1:28, Christopher Stone <listm...@suddenlink.net> wrote:
Hey Martin,

See this page.


The modules available won't have as comprehensive coloring as the Script Editor or Script Debugger, but they're better than nothing.

It must be the one I'm using...

Message has been deleted

Byers Media

unread,
Feb 20, 2023, 3:37:34 PM2/20/23
to bbe...@googlegroups.com
Greetings Media Mouth.
I took one of my prproj files and opened it with BBedit (14.6.4) and saw the XML data.

When I open it up in text edit, it displays random characters.
I tried to open the prproj file and a duplicated file changed the ext to XML file in visual studio code but it is random characters.

Interestingly enough, I took that XML extension and changed it to .gz, and then uncompressed it and that file opened up in text edit with the XML data. All 12000 lines, just like the prproj files, opened in bbedit.

Both end it </PremiereData>

Granted, my file is not corrupt.

I changed the unzipped file that opened in text edit extension to prproj double clicked to open it up in premiere pro. and it opened, plays, and saves.

I am not sure I helped out. But I do understand your question about BBedit and compressed files.


On Mon, Feb 20, 2023 at 12:07 PM Media Mouth <comm...@gmail.com> wrote:
NOTE: The main goal here is to diagnose and fix a corrupt XML file.

I've got an XML file that is compressed.  The extension is neither XML nor a compression.  It's a .prproj (Adobe Premiere Pro) project file.
.prproj is .xml content using a .prproj extension and compressed, I believe, using .gz compression.

If I change the extension from .prproj to .xml and open in BBEdit directly, it opens showing standard XML contents, albeit truncated before it ends.
That truncation originally gave the impression the file was corrupted by Adobe during a save which didn't complete.
If that's true, so be it -- there's nothing we can do.
BUT the subsequent steps thickened the plot a bit...

If I change the original file's extension to .gz and attempt to gunzip it, the attempt fails.
The same happens when attempting to decompress using the Mac OS app 'The Unarchiver' -- an error, BUT the app it will allow you to continue, and on a second attempt does somewhat successfully decompress the file.  This attempt results in a large, truncated XML file, almost the same as the BBEdit version, but not quite the same.  Wasn't expecting that different end point.


So a number of questions:
- Out of curiosity, what is BBEdit really doing when it detects the compression in the XML file.  Which decompression technique?  Is it using an auto-detect technique? Or something along the lines of gunzip?

- If gunzip, why was a Terminal attempt at decompressing the same file (with a .gz extension) using gunzip unsuccessful?

- If I make a change to the BBEdit-opened compressed XML file and save it, the resulting file size is still compressed, as if BBEdit opened and compressed XML and therefore saves it compressed.  There's no indication I'm aware of in BBEdit that the XML is compressed, so I'm not 100% sure of that, but if I copy/paste/save the contents into a new BBEdit file, save as XML, those same contents are 20X the size.  Is BBEdit quietly saving XML as compressed.  If so, is it indicated anywhere?

- Why would BBEdit and The Unarchiver.app decompress semi-successfully but to different end points?  Which leads to...

...The main question: What's the possibility the problem is NOT that Adobe failed midway through a save, and the problem is really some kind of compression hiccup -- that all the data's there, but we have to resolve the decompression hiccup and patch up the XML to recover the our original project file?


--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>

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

Byers Home Page

11773 Slow Poke Lane, Grass Valley, California 95945
Byers is committed to protecting your health and safety with a Virtual Consultation.

Reviews on Google • Give Us Feedback

We are here to help you Stay Safe!

Media Mouth

unread,
Feb 20, 2023, 3:42:47 PM2/20/23
to bbe...@googlegroups.com
Thanks Gerald,

Yes, I had a similar experience -- other text editors fail to see the XML of the PPro project where BBEdit reads it fluently.

I realize that somehow this post originally went into the wrong conversation so re-posted here.


Bruce Van Allen

unread,
Feb 20, 2023, 5:49:36 PM2/20/23
to bbe...@googlegroups.com
For a little insight, from the BBEdit manual:

## Manual ##
* Opening bz2, gzip, and tar Files and Binary plists

BBEdit transparently opens and displays the contents of any bz2 or gzip-compressed files (“.bz2”, “.gz” and “.gzip” files), as well as tarballs (“.tar” files) and binary plists (“.plist” files), both directly and during multi-file search.

. . .

If you make any changes to such a file and save it, BBEdit will automatically re-compress or re-convert the file on save.
## end ofManual excerpt ##



— Bruce

_bruce__van_allen__santa_cruz_ca_

Media Mouth

unread,
Feb 20, 2023, 6:28:26 PM2/20/23
to bbe...@googlegroups.com
Thanks Bruce! Fascinating. BBEdit is an amazing app.

Progress made, though it's not looking good for the file itself -- compression is fine, but underlying contents are incomplete and probably not recoverable.

Thanks again.
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> ---
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/2A7DB49A-8F44-45D6-A262-CE005198621E%40cruzio.com.

Reply all
Reply to author
Forward
0 new messages