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

How to copy an image to another folder?

Community Beginner ,
Aug 23, 2006 Aug 23, 2006
I am sure that there is a very simple answer to this question, but I have not been able to find anything in the Adobe Javascript documentation on how to copy an image!

I have a script that takes a series of selected thumbnails and generates a string that has the "destination" filename and path based on the EXIF date (e.g. NameString = "C:\\Photos\\2006\\2006-08-23\\image01.jpg").

What I would like to do now is to copy the selected image to this new path and filename. The folders may or may not exist. Here is an excerpt from my code:

var ImageName = decodeURI(thumb.spec.name);
var NewPath = DestPath + "\\" + YearString + "\\" + YearString + "-" + MonthString + "-" + DayString + "\\";
var DestinationFolder = new Thumbnail(Folder(NewPath));
var DestinationImage = new Thumbnail(File(NewPath+ImageName));
thumb.copyTo(DestinationImage);

Any suggestions are welcome.

Regards, Nigel
TOPICS
Scripting
411
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
New Here ,
Aug 28, 2006 Aug 28, 2006
LATEST
Hi Nigel,

are you looking for this snipplet?

if(!DestinationFolder.exists)
DestinationFolder.create();

markus
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