Copy link to clipboard
Copied
Hello Everyone,
Is there any way to open the JPG/PNG image from cc build.
I found a solution and implemented it in extension
app.open(File(filePath));
but it opens the file in photoshop and I want to get it open in OS image viewer app like: "Preview" for mac and "Image viewer" for Windows
You can try (in the JSX) to create a file instance and then execute it, like:
var f = new File('~/Desktop/flower.jpg')
if (f.exists) { f.execute() }
This should trigger the default app that is set for each OS (Preview on Mac, and Image viewer on Windows), provided that the user hasn't changed his OS preferences.
Hope this helps!
Davide
Copy link to clipboard
Copied
You would need to execute a system command not use a photoshop command.
app.system('the correct Mac or the correct windows command and pass the filePath');
for example this would stop the scriptlistener writting the javascript log file on windows
app.system('Attrib +R "%USERPROFILE%\\Desktop\\ScriptingListenerJS.log" ');
Copy link to clipboard
Copied
You can try (in the JSX) to create a file instance and then execute it, like:
var f = new File('~/Desktop/flower.jpg')
if (f.exists) { f.execute() }
This should trigger the default app that is set for each OS (Preview on Mac, and Image viewer on Windows), provided that the user hasn't changed his OS preferences.
Hope this helps!
Davide
Copy link to clipboard
Copied
Thanks, this was the solution I was looking for.
Thanks a log.
Copy link to clipboard
Copied
That can be unpredictable it could be Photoshop be the same as app.open(File(filePath));