Thread View: adobe.scripting.indesign
6 messages
6 total messages
Started by hm24_arul
Fri, 06 Mar 2009 07:36
Moving Indesign files
Author: hm24_arul
Date: Fri, 06 Mar 2009 07:36
Date: Fri, 06 Mar 2009 07:36
18 lines
1107 bytes
1107 bytes
Hi scripters,
here I am trying to move Indesign files from one path to another path
var myFolder = Folder.selectDialog("Please select a folder");
var myinddfolder = new Folder(myFolder.fullName + "/indd");
myinddfolder.create();
var myFiles=myFolder.getFiles( "*.indd" );
for ( i=0; i < myFiles.length; i++ ){ File(myFiles[i]).Move(myinddfolder); }
I think Indesign cant support with FSO(File System Object), the above code is my steps to move files, but I am getting error in Move command.
Please advice me how can I move files?
thanks in advance
regards
a r u l
Re: Moving Indesign files
Author: Kasyan_Servetsky
Date: Fri, 06 Mar 2009 07:55
Date: Fri, 06 Mar 2009 07:55
16 lines
1066 bytes
1066 bytes
Hi arul,
FSO is in Visual Basic, but your script is in JavaScript.
Kasyan
var myFolder = Folder.selectDialog("Please select a folder");
var myinddfolder = new Folder(myFolder.fullName + "/indd");
if (!myinddfolder.exists) myinddfolder.create();
var myFiles = myFolder.getFiles( "*.indd" );
for ( i = myFiles.length-1; i >= 0 ; i-- ){
var myResult = myFiles[i].copy(myinddfolder +"/" + myFiles[i].name);
if (myResult) myFiles[i].remove();
}
Re: Moving Indesign files
Author: hm24_arul
Date: Fri, 06 Mar 2009 08:48
Date: Fri, 06 Mar 2009 08:48
14 lines
821 bytes
821 bytes
Hi Kasyan
Thanks for your code, it works well. I got an idea from you.
Just suggest me whether we can use
ActiveXObject("Scripting.FileSystemObject");
method in Indesign javascript?
Thanks a lot again
regards
a r u l
Re: Moving Indesign files
Author: Andreas_Jansson
Date: Fri, 06 Mar 2009 09:19
Date: Fri, 06 Mar 2009 09:19
6 lines
809 bytes
809 bytes
Hi arul, Creating ActiveX objects within ExtendScrtipt Javascript of InDesign can't be done. You need to use the built-in File and Folder objects of InDesign, if you use the javascript language of InDesign. Best regards, Andreas
Re: Moving Indesign files
Author: Kasyan_Servetsky
Date: Fri, 06 Mar 2009 09:26
Date: Fri, 06 Mar 2009 09:26
1 lines
621 bytes
621 bytes
ActiveX is in VB. I don't think you can do it.
Re: Moving Indesign files
Author: hm24_arul
Date: Fri, 06 Mar 2009 10:22
Date: Fri, 06 Mar 2009 10:22
6 lines
683 bytes
683 bytes
Thanks a lot for your information Kasyan Servetsky & Andreas Jansson. Now I am clear. thanks regards a r u l
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads