Copy link to clipboard
Copied
Newb here, I'm writing a script for others to increment a layer in photoshop then export the photo before repeating. My thought to make it work on everyones system was to just dump the exported photos into C:, however, that's throwing an error 'target address unknown' whenever I run it. Is it possible to do relative addressing in JS? So wherever the script is located will be where the photos export to. If not I'd still like to throw it into the C: drive, I'm pretty sure the error is in how I formatted the address in line 5. Any tips? Thanks.
Copy link to clipboard
Copied
Does the user have rights to write to the root of the disk C:?
Try running photoshop "as administrator".
Copy link to clipboard
Copied
Thanks for the reply, yes PS is run as admin and the account is an admin account with full access.
Copy link to clipboard
Copied
It's strange. At me your script works in CS6 and СС 2018 without errors. Please show the screenshot of the error window. And tell me how you run the script.
Copy link to clipboard
Copied
Yes - same opinion as r-bin!
Tested with a sub folder in the path?
Copy link to clipboard
Copied
Here's the error message: Imgur: The magic of the Internet
I'm running in by going to scripts -> browse -> file.js
This in line 5 works: var saveFile = File('/C/Users/DW/Pictures/channel/' + i + '.png'); works.
var saveFile = File('/C/' + i + '.png') Does not work.
I'm trying to make it work on anyone's computer without having to modify the JS so I was just going to dump it onto the C drive which everyone should have.
Copy link to clipboard
Copied
Can you save the file to drive C: manually through the menu File->Save fow Web... ?