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

I want to move the file in active document

Participant ,
Feb 12, 2021 Feb 12, 2021

var path1="E:/FG/";
Folder((fnp = (fle = (aD = activeDocument).name).parent + '/USED IMAGE/')).create(), File(fle).remove()
aD.saveAs(File(fnp + aD.name), new JPEGSaveOptions()),aD.saveAs(File(path1+aD.name), new JPEGSaveOptions()),aD.close(SaveOptions.DONOTSAVECHANGES);

 

I wish in active document of image file move the directory and don't close the file.. Is that possible ??

Thanks in Advance

TOPICS
Actions and scripting
1.9K
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

correct answers 1 Correct answer

LEGEND , Feb 12, 2021 Feb 12, 2021

So not the file, but the layer? Then you can't move it, but export...

Translate
Adobe
LEGEND ,
Feb 12, 2021 Feb 12, 2021

Use rename method or others, more complicated: To move files and folders

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
Participant ,
Feb 12, 2021 Feb 12, 2021

I want to move the active document in directory. And Don't close the file

This script work only Active Document.

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
LEGEND ,
Feb 12, 2021 Feb 12, 2021

After you move file it lose its original path, so you must save it using new location.

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
Participant ,
Feb 12, 2021 Feb 12, 2021

dsd.JPG

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
Participant ,
Feb 12, 2021 Feb 12, 2021

It's close the file in Photoshop , I want to move the file without close the image file in photoshop

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
Mentor ,
Feb 12, 2021 Feb 12, 2021

 

Folder (path1=("E:/FG/")).create();
Folder((fnp = (fle = (aD = activeDocument).fullName).path + '/USED IMAGE/')).create();
File(fle).remove();
aD.saveAs(File(fnp + aD.name), new JPEGSaveOptions());
aD.saveAs(File(path1+"/" + aD.name), new JPEGSaveOptions());

 

I didn't understand the question a little. In the text you write one thing, and in the code - another.

 

You save the file twice: 

- first time to USED IMAGE subdirectory

- second time to directory E: / FG /

Accordingly the file path changes twice

 

If you only need to put the file in a subfolder - remove the last line

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
Participant ,
Feb 12, 2021 Feb 12, 2021

It's not execute the script. Last Line is getting a error..

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
Participant ,
Feb 12, 2021 Feb 12, 2021

Remove the image file in original folder. 

USED IMAGE Directory and Second Directory Move the image file from Original Foder , But In Photoshop don't close the file ...

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
Mentor ,
Feb 12, 2021 Feb 12, 2021

I have edited the code. Try again - there was an error in the first line.

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
Participant ,
Feb 12, 2021 Feb 12, 2021

Folder (path1=("E:/FG/")).create();
Folder((fnp = (fle = (aD = activeDocument).name).path + '/USED IMAGE/')).create();
File(fle).remove();
aD.saveAs(File(fnp + aD.name), new JPEGSaveOptions());
aD.saveAs(File(path1+"/" + aD.name), new JPEGSaveOptions());

 

Getting error in 3no lines..

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
Mentor ,
Feb 12, 2021 Feb 12, 2021

This is not my code. You have modified it.

activeDocument.name - it is a string that stores the name of the document. It has no path property 

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
Participant ,
Feb 12, 2021 Feb 12, 2021

sf.JPG

I want to move the image file from document.

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
LEGEND ,
Feb 12, 2021 Feb 12, 2021

You say it closes the file in Photosop, when exactly?

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
LEGEND ,
Feb 12, 2021 Feb 12, 2021

So you want to move or copy the file?

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
Participant ,
Feb 12, 2021 Feb 12, 2021

I want to move the file without closing file in photoshop

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
LEGEND ,
Feb 12, 2021 Feb 12, 2021

So save it in new location, and then remove the original 😉

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
Participant ,
Feb 12, 2021 Feb 12, 2021

sf.JPG

I want to move the image file from document and without close the image file

Move the File 

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
LEGEND ,
Feb 12, 2021 Feb 12, 2021

Do you mean export the layer?

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
Participant ,
Feb 12, 2021 Feb 12, 2021

I mean move the layer to directory and without close..

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
LEGEND ,
Feb 12, 2021 Feb 12, 2021
LATEST

So not the file, but the layer? Then you can't move it, but export...

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