Copy link to clipboard
Copied
Hi,
I had the script below in a .jsx file, and it was located at "Adobe Photoshop CC 2015/Presets/Scripts", and it worked perfectly.
Now for some unknown reason - it will no longer open the hard-coded folder in the finder
Has something changed in a previous update, which renders this script useless?
Any ideas how I now simply open up a folder in the finder, directly from a script?
Thank you all in advance.
var f = File('Applications/Files/Photoshop\ Tuts\ and\ Plugins/Photoshop\ Plugins/');
f.execute();
If that is what was returned then this should work.
var f = Folder("/Applications/Files/Photoshop_Tuts_and_Plugins/Photoshop_Plugins");
if(f.exists){
f.execute();
}else{
alert("Folder does not exist\nPlease check your path!");
}
Copy link to clipboard
Copied
You are using a File object where it should be a Folder object.
You are mixing forward and back slash, when useing backslash you Must use \\
var f = Folder('Applications/Files/Photoshop/Tuts/and/Plugins/Photoshop/Plugins/');
if(f.exists){
f.execute();
}else{
alert("Folder does not exist\nPlease check your path!");
}
Copy link to clipboard
Copied
Hi.
Thank you for the response, but now all I get is the alert message saying the path does not exist?
I have renamed the directory names, so here is the script which I now have:
var f = Folder('Applications/Files/Photoshop_Tuts_and_Plugins/Photoshop_Plugins');
if(f.exists){
f.execute();
}else{
alert("Folder does not exist\nPlease check your path!");
}
I have double checked the spelling and the path, and it is all correct, so I still have no idea why this folder is not opening?
Any other ideas would be welcomed.
Copy link to clipboard
Copied
var f = Folder('Applications/Files/Photoshop_Tuts_and_Plugins/Photoshop_Plugins');
should probably be
var f = Folder('/Applications/Files/Photoshop_Tuts_and_Plugins/Photoshop_Plugins');
Copy link to clipboard
Copied
Run this line of code from ExtenScript Toolkit and select the folder
$.writeln(decodeURI(Folder.selectDialog("Please select folder")));
Your correct path should then be written to the console and you can copy it from there.
Copy link to clipboard
Copied
xbytor2: The preceeding slash made no difference
SuperMerlin: The console returned this:
/Applications/Files/Photoshop_Tuts_and_Plugins/Photoshop_Plugins
So it seems that with or without the preceeding slash,, it still refuses to work?
Copy link to clipboard
Copied
If that is what was returned then this should work.
var f = Folder("/Applications/Files/Photoshop_Tuts_and_Plugins/Photoshop_Plugins");
if(f.exists){
f.execute();
}else{
alert("Folder does not exist\nPlease check your path!");
}
Copy link to clipboard
Copied
That worked this time!
Must have been due to using double quotes, as opposed to the original single quotes??
Thank you so much for all the help, both of you.
It is very much appreciated!