joonaspaakko / Batch-Mockup-Smart-Object-Replacement-photoshop-script

Batch Mockup Smart Object Replacement - Photoshop script - A script that can batch process multiple mockup files and is able to replace multiple smart objects per mockup.
91 stars 23 forks source link

Issues with running script in different folder than download folder #10

Closed TimKerre closed 2 years ago

TimKerre commented 2 years ago

Hi,

I managed to get the script going but only in the downloads folder, once I replace the script and try to change to path to the new one it always gives my an error 25. I checked the documentation but I'm unable to resolve this issue myself. Can you tell me what I'm doing wrong?

I took some screenshots of my current script settings and the error message. Thanks!

Error 25 Script settings
joonaspaakko commented 2 years ago

This might not be it, but looking at the screenshot and the error that seems to point to line 1, I have to say I think it's the "raw" path you have there in the file on line 1 that you should delete or comment out with the prefix //.

That's my best guess right now. There might even be other issues after that is removed.

TimKerre commented 2 years ago

Thank you for trying to help me out. I have commented out the first line, however know photoshop is giving me an error saying that the folder does not exist.. Any other

Schermafbeelding 2021-10-13 220457 Schermafbeelding 2021-10-13 220535

idea on what this could be?

joonaspaakko commented 2 years ago

Relative paths can be difficult to figure out. The problem likely sits somewhere in there. Right now your #include path starts wherever this Settings script.jsx is and from there with the two ../ it goes 2 folders up and then tries to look for the folder timke and the rest of it is just nested folders.

The most simple relative path would be to move the Batch Mockup Smart Object Replacement.jsx script in the same folder as your Settings script.jsx and then change the include to #include "Batch Mockup Smart Object Replacement.jsx". that, or an absolute path.

You shouldn't copy & paste anything I wrote there, I'm writing this on my phone.


What I said in this comment before still stands, but to further clarify, looking at the now commented out path again, the relative path you have is actually impossible.

If you only had one ../ it could still work. For example if you had the settings script at C:/test/Settings script.jsx then the include path could start with../timke, because you go one folder up and then look for "timke".

With the two ../../ you'd be going 1 folder too far looking for "timke" outside of C drive, which is not possible.

My best guess is that you kinda combined an absolute and a relative path and ended up with too much stuff in the path.

TimKerre commented 2 years ago

Yes what your saying is correct, but still deleting one ../ did not fix the issue.. Nonetheless after changing it to an absolute path it works now :-) One strange thing is that OneDrive does not accept the 'standard' image output names and therefore can not save the images, but after moving the script to my local disk it works perfectly. Thanks for helping me out, really appreciate it!

joonaspaakko commented 2 years ago

Good. Yea a single ../ would've only worked if your settings script was one folder deep in the C drive, which I'm guessing it wasn't.

I should add that the standalone example's include path works as is, so if you get similar issues you can always download that again and see how that is setup. Unless you change the folder structure, there shouldn't be a need to change the include path in that example project.

TimKerre commented 2 years ago

Ok that is great, thanks for letting me know.