Copy link to clipboard
Copied
HI!
I want to open a file/image with a button click in an extension, in photoshop >> javascript.
Possibly with relative path to the extension file (it have to work on several different computers)
I tried several scripts:
===================================================================================
function somename(){
#target photoshop
var fileRef = "C:\\Users\\Username\\Desktop\\scripting\\image.png" // I tried several differnet syntay about the path >> / \ \\ etc. etc.
var doc = open(fileRef);
}
================ OR ==================================================================
function somename2(){
#target photoshop
var fileRef = new File( ~/desktop/scripting/image.png ) // I tried several differnet syntay about the path >> / \ \\ etc. etc.
app.open(fileRef)
}
======================================================
I know these paths are absolute but >> None of them had work so far
Any ideas?
ps: im new to this >> please be specific or provide some example 🙂 thanks!
okay a little update!
Thanks Davide!
this works >> just i was a little to beginner to correctly interpret Davide answer.
So i put these code to the main.js file inside the JS folder:
...(function () {
'use strict';
var csInterface = new CSInterface();
function init() {
themeManager.init();
$("#something_1").click(function () {
var csInterface = new CSInterface();
var extensionPath = csInterface.getSystemPath(SystemPath.EXTENSION);
var
Copy link to clipboard
Copied
Auto Fill Frame ..So I am tired Please Slove this problem
Copy link to clipboard
Copied
Thanks for your help, I'm going to move this question into a new thread.