• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

error: passing value from apple script to javascript

Participant ,
May 24, 2024 May 24, 2024

Copy link to clipboard

Copied

I can use similar logic to passing value with illustrator, but PS occur an error. why ?
There is no problem with the file path. Is it related to security permissions?
also,  Software Menu---File----scripts----browse, then I can't select .scpt format file, it is strange.
result:
error "Adobe Photoshop 2024 got an error: Can’t get file \"Macintosh HD:Users:c144:Desktop:thScript:CovertBMP.jsx\"." number -1728 from file "Macintosh HD:Users:c144:Desktop:thScript:CovertBMP.jsx"


applescript:
set userName to short user name of (system info)
set baseFolderPath to "/Users/" & userName & "/Desktop/thScript/"
set scriptFileName to "CovertBMP.jsx"
set scriptPath to baseFolderPath & scriptFileName as POSIX file
set nameParameter to {"1887-9-01.eps", "1887-9-(1).bmp", "600", "/Users/c144/Desktop/thScript/"}
set argumentsList to {nameParameter}
tell application "Adobe Photoshop 2024"
activate
do javascript scriptPath with arguments argumentsList
end tell

javascript:
#target Photoshop
var arr = [];
function main(dataIn) {
var value1 = dataIn[0];
var value2 = dataIn[1];
var value3 = dataIn[2];
var value4 = dataIn[3];
arr.push(value1);
arr.push(value2);
arr.push(value3);
arr.push(value4);
}
main(arguments[0]);
var epsName = arr[0] ;
var bmpName = arr[1];
var pixels = arr[2];
var folderPath = arr[3];

TOPICS
Actions and scripting

Views

85

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , May 26, 2024 May 26, 2024

code should use "do javascript of file scriptPath with arguments argumentsList"

Votes

Translate

Translate
Adobe
Participant ,
May 26, 2024 May 26, 2024

Copy link to clipboard

Copied

LATEST

code should use "do javascript of file scriptPath with arguments argumentsList"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines