Current Position:Home > Trouble with loadMasters function.

Trouble with loadMasters function.

Update:11-30Source: network consolidation
Advertisement
Hey everybody,
I'm trying to automate the replacement of a number of master spreads across many documents. Unfortunately, I keep getting the following error:
Error Number: 48
Error String: Cannot find the folder " ".
Both of these code snippets give the same result:
var oldDocument = File("/c/Users/me/Desktop/Template.indt")
myDocument.loadMasters(oldDocument.fullName);
myDocument.loadMasters(File("/c/Users/me/Desktop/Template.indt").fullName);
If I have the document open from which I'm loading the masters, the following code works:
myDocument.loadMasters(app.documents.item("Template.indt").fullName);
The problem is, I don't want to have that file open while performing the script. Thanks in advance for your help!

The Best Answer

Advertisement
Hi Camb,
Please try the below JS code. i have modified your code its working fine.
app.scriptPreferences.userInteractionLevel=UserInteractionLevels.neverInteract;
var oldDocument = File("~/Desktop/Template.indt")
app.activeDocument.loadMasters(oldDocument, GlobalClashResolutionStrategyForMasterPage.LOAD_ALL_WITH_OVERWRITE);
app.scriptPreferences.userInteractionLevel=UserInteractionLevels.INTERACT_WITH_ALL;
thx
csm_phil
  • Trouble with loadMasters function. Update:11-30

    Hey everybody, I'm trying to automate the replacement of a number of master spreads across many documents. Unfortunately, I keep getting the following error: Error Number: 48 Error String: Cannot find the folder " ". Both of these code snippets

  • Troubled over "enhance" function Update:11-30

    I always try the iPhoto auto enhance function with a "ok,what do you expect"-sort of attitude - until using the enhance function in Pages/keynote - colors suddenly perfect, picture just right. This troubles me - am I missing something? Or did Ap

  • Trouble using a function in the where clause Update:10-11

    Hello, I am using a function found at ask.tom.oracle.com which converts a long data type to a character. The function is returning an error when it is placed in the where clause. The sql statement , error message and the function from ask tom are sho

  • I am having trouble implementing scripting functionality in an indesign template for a DPS project. Update:10-11

    Basically how should the interaction between inserted HTML and the CSS, JS applied for the HTML happen? I created plain HTML code which has text fields, buttons and the functions that perform some simple calculations. But when imported via Object>Ins

  • I am having trouble with a function in vb can anyone give me a suggestion? Update:11-20

    I am trying to calculate a cable bill of a residential customer and a business customer, when the customer checks the list box of the channels and the connections I need it to add it up. I have edited the code. Does my logic make sense? for residenti

  • Trouble with median function Update:11-30

    I need to use median function in fact table in my repository. In business model I have fact table with logical column(column where I used median function with name "MyCalculacion"). And I have Time dimension with column ("Year", "

  • N73 - trouble with search function for the contact... Update:11-30

    Hi, i just bought a N73 series phone. i noticed that N73 search function for the contact list is different from others standard. Normally, it should show the 1st contact of the 1st letter that i pressed instead of the contact contains the letter. I f

  • Trouble with SDK function get_Location Update:11-30

    Hello! I'm using the itunes' SDK to develop an application using C++. Everything is fine, except the IITFileOrCDTrack object's get_Location() doesn't seem to work. ----snip---- iTunes *iITunes = 0; iTTrack *iITrack = 0; HRESULT hRes; hRes = ::CoCreat

  • Trouble with Preview function- thumbnails Update:11-30

    Adobe photoshop elements 9:  Problem occurs after downloading my images from my camera's memory card.  I have all the thumbnails open & have always right clicked on an individual photo, hit preview & viewed my photos as a slideshow to copy, delete

  • Trouble with JSTL functions uri Update:11-30

    I have JSTL 1.1 installed, am using J2EE 1.3 on Websphere 5.0 and am referencing 2.3 DTD in my web.xml. I have the jstl.jar, standard.jar, jdbc2_0-stdext.jar, xalan.jar and xercesImpl.jar in WEB-INF/lib I can successfully use the core JSTL functions