make a .jsx script from a text file for Indesign? - ehMac.ca
Facebook
Twitter
YouTube
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Advertise


Reply
 
LinkBack Thread Tools Display Modes
Old Jul 9th, 2020, 12:48 PM   #1
Honourable Citizen
 
wonderings's Avatar
 
Join Date: Jun 2003
Location: Waterloo
Posts: 5,241
make a .jsx script from a text file for Indesign?

When hunting around for a solution to make life a bit easier with a specific job I came across someone who wrote a script that should do exactly what I need. The problem is I have no idea how to make this script into a .jsx file that will work in Indesign.

I am using the latest version of Indesign CC.

I copied and pasted the info from the website into textedit. I then saved as an RTF as txt is not an option. I then changed the extension to .jsx and put it in the appropriate folder. Indesign shows it but it is greyed out. I am assuming I have done something wrong here. Is there a correct way I should be making a .jsx file on a Mac?

This is the script I want:

(function () {
var curDoc = app.activeDocument,
allPages = curDoc.pages,
nPages = allPages.length,
curPage,
i,p,
newMaster = curDoc.masterSpreads.itemByName("B-Masterpage");

for (i = nPages-1; i >= 0; i--) {
curPage = allPages[i];
p = curDoc.pages.add({appliedMaster: newMaster});
p.move(LocationOptions.AFTER, curPage);
}
}) ();
__________________
“If you are neutral in situations of injustice, you have chosen the side of the oppressor. If an elephant has its foot on the tail of a mouse and you say that you are neutral, the mouse will not appreciate your neutrality.” Bishop Desmond Tutu
wonderings is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old Jul 9th, 2020, 03:50 PM   #2
Honourable Citizen
 
pm-r's Avatar
 
Join Date: May 2009
Location: Brentwood Bay BC
Posts: 14,904
Quote:
I am assuming I have done something wrong here. Is there a correct way I should be making a .jsx file on a Mac?

How about checking out some of these hits with a Google search...???:

making a .jsx file on a Mac
https://www.google.com/search?q=maki...hrome&ie=UTF-8




- Patrick
======
pm-r is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 12:39 PM.



Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright © 1999 - 2012, ehMac.ca All rights reserved. ehMac is not affiliated with Apple Inc. Mac, iPod, iTunes, iPhone, Apple TV are trademarks of Apple Inc. Content Relevant URLs by vBSEO 3.6.0 RC 2

Tribe.ca: Urban living in Toronto!