Skip to main content
BEGINNER_X
Legend
November 7, 2013
Answered

Copy and Paste in selected folder

  • November 7, 2013
  • 1 reply
  • 846 views

Hi All,

I need to select(copy) ".pdf" files and paste into selected folder.

Using Mac.

var file = File.openDialog("Please choose PDF", "PDF:*.pdf");

var destinationFolder = Folder.selectDialog("Select Paste Folder");

Could anyone help on this.

Thanks in advance

Beginner_X

This topic has been closed for replies.
Correct answer Sajeev Sridharan

Try this, (tested in windows not Mac)

var file = File.openDialog("Please choose PDF", "PDF:*.pdf");

var destinationFolder = Folder.selectDialog("Select Paste Folder");

var target = File(destinationFolder + "/" + file.name);

file.copy(target);

Vandy

1 reply

Sajeev SridharanCorrect answer
Legend
November 7, 2013

Try this, (tested in windows not Mac)

var file = File.openDialog("Please choose PDF", "PDF:*.pdf");

var destinationFolder = Folder.selectDialog("Select Paste Folder");

var target = File(destinationFolder + "/" + file.name);

file.copy(target);

Vandy

BEGINNER_X
Legend
November 7, 2013

Hi vandy,

Thanks for your response. Its works like a charm...

I tuned the above coding for copy folder and paste in the selected folder.

But it should be fail.

var file = Folder.selectDialog("Select Copy Folder");

var destinationFolder = Folder.selectDialog("Select Paste Folder");

var target = File(destinationFolder + "/" + file.name);

file.copy(target);

Could you please help for the request.

Thanks in advance

Beginner_X

Legend
November 7, 2013

May be something like this, I haven't tested it

var file = Folder.selectDialog("Select Copy Folder");  

var destinationFolder = Folder.selectDialog("Select Paste Folder");  

file.copy(destinationFolder);

Vandy