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

Copying External files using scripting is really slow

Community Beginner ,
Feb 24, 2023 Feb 24, 2023

As part of a larger script I am asking Photoshop to make a copy of an existing photoshop file and move it to a secondary folder. 

Whilst the script does do copy process it takes forever to do, It's not a network issue as I can perform the same operation either manually or using other scripting languages and it goes at a speed that I would expect. The difference in time can be several minutes. 

Is this a common issue or am i using .copy incorrectly. 

the line of code I am using is :

if (!compfile.copy(ssFile))alert(ssFile.error)
 
compfile and ssFile have both been defined properly otherwise it wouldn't work ( even if it is slow)


Many thanks for any help

Anthony

TOPICS
Actions and scripting , Windows
872
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 24, 2023 Feb 24, 2023

File.copy returns true if successful.

You can use app.system() to make command line calls, this might be faster.

On the Mac, ditto or mv should work. I think cp is the Windows command.

Translate
Adobe
LEGEND ,
Feb 24, 2023 Feb 24, 2023

File.copy returns true if successful.

You can use app.system() to make command line calls, this might be faster.

On the Mac, ditto or mv should work. I think cp is the Windows command.

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
Community Beginner ,
Feb 25, 2023 Feb 25, 2023
LATEST

Thanks Lumigraphics

I for reference for others I used the following in the end:

Var cmdcompFile = DEFINE ORIGINAL FILE
Var cmdcompFile = DEFINE COPY FILE
cmd = 'cmd.exe /c cmd.exe /c \" copy '+cmdcompFile+" "+cmdssFile
app.system(cmd);
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