ehMac.ca

ehMac.ca (http://www.ehmac.ca/index.php)
-   Mac Masters (http://www.ehmac.ca/forumdisplay.php?f=59)
-   -   make a .jsx script from a text file for Indesign? (http://www.ehmac.ca/showthread.php?t=154222)

wonderings Jul 9th, 2020 01:48 PM

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);
}
}) ();

pm-r Jul 9th, 2020 04:50 PM

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


All times are GMT -4. The time now is 03:46 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 RC 2
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.