Why using .JSX?

Community Beginner ,
Apr 27, 2011 Apr 27, 2011

Copy link to clipboard

Copied

Hi,

i have a basic question. Is it of any importance to use the .jsx extension instead of the .js?

Best

:F

TOPICS
Scripting

Views

2.8K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 28, 2011 Apr 28, 2011

Copy link to clipboard

Copied

Hello,

I think you could use ".js" extension instead of ".jsx" but I cannot find any advantage on this (BTW, I tried importing some scripts on the InDesign scripts panel with the ".js" extension and they work without any problem).

".jsx" stays for ExtendScript which is - as you know - a "special" version of Javascript, the same way as ActionScript (.as) is again a "special" version of Javascript too.

Best,

Luca

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 28, 2011 Apr 28, 2011

Copy link to clipboard

Copied

js will work.

The main advantage to using jsx is in regard to file associations. jsx is associated with the ESTK, so if you open a jsx file it will open in ESTK. js files very often have other associations (such as Dreamweaver)...

Harbs

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 28, 2011 Apr 28, 2011

Copy link to clipboard

Copied

So it is only the file association with the ESTK?

The advantage for me in .js is

- OSX Quicklook works with .js

- Git seems to have (sometimes) problems with .jsx

I thought maybee there is some tiny hidden but super important feature when using. jsx

Thanx a lot

:F

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 28, 2011 Apr 28, 2011

Copy link to clipboard

Copied

JSX files created by BBEdit or TextWrangler also work with Quicklook...

Harbs

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 28, 2011 Apr 28, 2011

Copy link to clipboard

Copied

Really?

The JSX files I produce with TextMate and with the ESTK don't work with Quicklook (OSX 10.6.7).

Could for some reason the encoding be a problem?

I tried to change the encoding, but the terminal says always: charset=us-ascii

Or is there some other way to make the system treat the .jsx files like .js files?

I already know how to associate the extension with a program (e.g. TextMate) that works.

But the QuickLook problem is anoying me.

:F

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 28, 2011 Apr 28, 2011

Copy link to clipboard

Copied

I once started looking into making a Spotlight plugin for jsx files (I care about Spotlight more than I care about Quicklook). When I discovered that TextWrangler and BBEdit make them indexible, I gave up on that exercise. BBEdit is my preferred app for writing scripts anyway.

You only need them to save the file once for them to be searchable and openable by Quicklook. I'm not sure what does it, but it's one of the other pieces of metadata which does the trick...

Harbs

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 29, 2022 Jan 29, 2022

Copy link to clipboard

Copied

LATEST

@fabianmoronzirfas  wrote:

But the QuickLook problem is anoying me.


 

Sollte das Problem (nach Jahren) noch aktuell sein, dann bietet die Quick Look Extension Syntax Highlight womöglich Abhilfe:

https://github.com/sbarex/SourceCodeSyntaxHighlight 

 

Martin

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines