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

Help with GREP Style - formatting number

Community Beginner ,
Dec 06, 2019 Dec 06, 2019

I am trying to figure out how to use GREP to add comma and $ to numbers

 

For example,

 

one GREP configuration to turn 5 digit numbers such as 2000 into $2,000 

and one for turning 6 digits numbers such as 20000 into $20,000

 

I have tried using the "price adjuster script" below though no luck.

http://www.kahrel.plus.com/indesign/price_adjuster.html

I get an (i) warning in InDesign stating "This file is not executable by any supported script language.

 

Any help will be much appreciated !

 

TOPICS
How to
1.0K
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

correct answers 2 Correct answers

Community Expert , Dec 06, 2019 Dec 06, 2019

Can you detail as to how did you try to execute the script to get this error. What is the name of the script file that you saved, it should be saved in .jsx extension.

 

-Manan

Translate
Community Expert , Dec 07, 2019 Dec 07, 2019

This script is not meant to be executed in Chrome so its fine that you get errors on Chrome. For executing you just need to double click on the script in the Scripts panel of InDesign. I did try it on my machine and everything seems to be working. Have a look at the gif below

Demo.gif

 

Also what happens if you edit one of the sample jsx files, and paste the content of the downloaded jsx file into this file and then try to run the script?

 

-Manan

Translate
Community Expert ,
Dec 06, 2019 Dec 06, 2019

Can you detail as to how did you try to execute the script to get this error. What is the name of the script file that you saved, it should be saved in .jsx extension.

 

-Manan

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
Community Beginner ,
Dec 07, 2019 Dec 07, 2019

I have downloaded the scrip into my desktop, the file is - price_adjuster.jsx

 

I then opened indesign, went to the script window - clicked to revel the folder (user) and placed the scrip inside the folder (Scripts Panel). 

 

All my scripts have a (i) warning that display the "This file is not executable by any supported script language."  when I hover over it. 

 

Annotation 2019-12-07 190024.png

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
Community Expert ,
Dec 07, 2019 Dec 07, 2019

What is the version of the InDesign that you are using? I suppose you are using a Windows machine, could this be a persmission issue of the folder or the jsx file. Try placing the file directly in the Javascript folder and then try to execute, you could also try by creating a new jsx file using notepad and paste the content of the jsx downloaded from the site to this file and then try to execute it

 

-Manan

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
Community Beginner ,
Dec 07, 2019 Dec 07, 2019

I am using version 15.0 

 

I tried looking at folder and file permission but it seems to be all in order. 

I also tried creating a jsx file in notepad but to no avail so far. I am not sure in which folder in the Javascript folder I should place the file and how to execute? 

 

I tried executing it on chrome and I got an error as below

 

VM73:72 Uncaught Reference
Error: app is not defined at getData (<anonymous>:72:17) at <anonymous>:299:13 at <anonymous>:302:2
 getData@VM73:72
 (anonymous)@VM73:299
 (anonymous)@VM73:302

 

Cheers

 

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
Community Expert ,
Dec 07, 2019 Dec 07, 2019

This script is not meant to be executed in Chrome so its fine that you get errors on Chrome. For executing you just need to double click on the script in the Scripts panel of InDesign. I did try it on my machine and everything seems to be working. Have a look at the gif below

Demo.gif

 

Also what happens if you edit one of the sample jsx files, and paste the content of the downloaded jsx file into this file and then try to run the script?

 

-Manan

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
Community Beginner ,
Dec 07, 2019 Dec 07, 2019

VOiala! First of all, it looks like the main issue was that I thought my file extension was .JSX when in fact it was simply a text document. See below - my insurmountable ignorance is virtually unfathomable at this point to put it lightly. 

 

Annotation 2019-12-07 203518.png

Secondly, I have followed the same path as shown in your gif, and along with the REAL JSX file, which I made it work by copying the script into a real notepad instead of a text document and VOiala ! ! all working!

Manan, I appreciate you taking the time...! You're too kind and I am thankful for you help! 

 

Cheers!

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
Community Expert ,
Dec 07, 2019 Dec 07, 2019
LATEST

Glad that you are back on track. Cheers

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