RE: ExtendScript - how to open a file

2013-12-24 Thread Harro de Jong
 
 Thanks to Rick Quatro I now have a working script.


I didn't solve the problem with my script, btw. Rick provided me with a working 
'shell' script for processing all the files in a book, so I used that method 
instead of my initial idea to process all the files in a directory. 

Harro de Jong
___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


ExtendScript - how to open a file

2013-12-22 Thread Harro de Jong

> Thanks to Rick Quatro I now have a working script.


I didn't solve the problem with my script, btw. Rick provided me with a working 
'shell' script for processing all the files in a book, so I used that method 
instead of my initial idea to process all the files in a directory. 

Harro de Jong


RE: ExtendScript - how to open a file

2013-12-20 Thread Harro de Jong
Harro de Jong wrote: 


 
 I'm trying to create my first ExtendScript to automate converting a batch of
 FM11 documents to FM10. The goal is to point the script to a folder, and have 
 it
 convert all FM files in this folder.

Thanks to Rick Quatro I now have a working script. 



Harro de Jong
Triview
___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


ExtendScript - how to open a file

2013-12-20 Thread Harro de Jong
Harro de Jong wrote: 


> 
> I'm trying to create my first ExtendScript to automate converting a batch of
> FM11 documents to FM10. The goal is to point the script to a folder, and have 
> it
> convert all FM files in this folder.

Thanks to Rick Quatro I now have a working script. 



Harro de Jong
Triview


ExtendScript - how to open a file

2013-12-18 Thread Harro de Jong
Hi all,

I'm trying to create my first ExtendScript to automate converting a batch of 
FM11 documents to FM10. The goal is to point the script to a folder, and have 
it convert all FM files in this folder.
I've cobbled together the following. I'm getting tripped up by the command to 
open a file (var doc = app.open(bestand);). I copied this from a Photoshop 
script, but it doesn't work in FrameMaker. The Extendscript IDE isn't very 
helpful, and the few FrameMaker examples I've found all work on the active 
document or book.
How do I open a file?


#target framemaker

var inputFolder = Folder.selectDialog(Input folder);
var outputFolder = Folder.selectDialog(Output folder);
var name, saveParams, i;

if (inputFolder != null  outputFolder != null) {
var files = inputFolder.getFiles(*.fm);
for (var i = 0; i  files.length; i++) {
var bestand = files[i];

var doc = app.open(bestand);
name = doc.Name;
  saveParams = GetSaveDefaultParams();
  returnParams = new PropVals();
  i = GetPropIndex(saveParams, Constants.FS_FileType);
  saveParams[i].propVal.ival 
=Constants.FV_SaveFmtBinary100;
  doc.Save(name, saveParams, returnParams);
  doc.Close(Constants.FF_CLOSE_MODIFIED);

 doc.close(SaveOptions.DONOTSAVECHANGES);
$.writeln('File ' + (i + 1) + ' of ' + files.length + ' processed');
}

}

Kind regards,
Harro de Jong


___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


ExtendScript - how to open a file

2013-12-18 Thread Harro de Jong
Hi all,

I'm trying to create my first ExtendScript to automate converting a batch of 
FM11 documents to FM10. The goal is to point the script to a folder, and have 
it convert all FM files in this folder.
I've cobbled together the following. I'm getting tripped up by the command to 
open a file (var doc = app.open(bestand);). I copied this from a Photoshop 
script, but it doesn't work in FrameMaker. The Extendscript IDE isn't very 
helpful, and the few FrameMaker examples I've found all work on the active 
document or book.
How do I open a file?


#target "framemaker"

var inputFolder = Folder.selectDialog("Input folder");
var outputFolder = Folder.selectDialog("Output folder");
var name, saveParams, i;

if (inputFolder != null && outputFolder != null) {
var files = inputFolder.getFiles("*.fm");
for (var i = 0; i < files.length; i++) {
var bestand = files[i];

var doc = app.open(bestand);
name = doc.Name;
  saveParams = GetSaveDefaultParams();
  returnParams = new PropVals();
  i = GetPropIndex(saveParams, Constants.FS_FileType);
  saveParams[i].propVal.ival 
=Constants.FV_SaveFmtBinary100;
  doc.Save(name, saveParams, returnParams);
  doc.Close(Constants.FF_CLOSE_MODIFIED);

 doc.close(SaveOptions.DONOTSAVECHANGES);
$.writeln('File ' + (i + 1) + ' of ' + files.length + ' processed');
}

}

Kind regards,
Harro de Jong


-- next part --
An HTML attachment was scrubbed...
URL: