Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Why using .JSX?

Explorer ,
Apr 27, 2011 Apr 27, 2011

Hi,

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

Best

:F

TOPICS
Scripting
3.5K
Translate
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

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

Translate
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

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

Translate
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
Explorer ,
Apr 28, 2011 Apr 28, 2011

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

Translate
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

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

Harbs

Translate
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
Explorer ,
Apr 28, 2011 Apr 28, 2011

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

Translate
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

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

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

Translate
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