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

loadPlaceGun error

Enthusiast ,
Oct 26, 2014 Oct 26, 2014

Hi,

When I run the following script for the first time, I get an error (the file don't exist or you don't have the access or the file is use by another application) [InDesign CC 2014 v10.0].

If I run it again it works. Do you have an idea to fix this ?

Thank you for your help
Regards


var myFileArray= new Array;

var OutPutFile1 = new File("~/Documents/myfile1.txt");

var OutPutFile2 = new File("~/Documents/myfile2.txt");

// create and  write files

OutPutFile1.encoding = "UCS-2";

OutPutFile1.lineFeed="Unix";

OutPutFile1.open( "w" );

OutPutFile1.writeln("foo1");

OutPutFile1.close();

//

OutPutFile2.encoding = "UCS-2";

OutPutFile2.lineFeed="Unix";

OutPutFile2.open( "w" );

OutPutFile2.writeln("foo2");

OutPutFile2.close(); ;

//push files in array

myFileArray.push(OutPutFile1);

myFileArray.push(OutPutFile2);

//load place gun          

app.activeDocument.placeGuns.loadPlaceGun(myFileArray);


TOPICS
Scripting
262
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
no replies

Have something to add?

Join the conversation