# make a .jsx script from a text file for Indesign?



## wonderings (Jun 10, 2003)

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_;
p = curDoc.pages.add({appliedMaster: newMaster});
p.move(LocationOptions.AFTER, curPage);
}
}) ();_


----------



## pm-r (May 17, 2009)

> 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=mak...rome..69i57.3102j0j7&sourceid=chrome&ie=UTF-8




- Patrick
======


----------

