Copy link to clipboard
Copied
Hi,
I have a fully functional scriptUI window.
If I export the script as binary, the window appears suddenly then close.
Usually, this problem is solved by #targetengine session
But this line does exists in the script. So it seems that the matter really comes from the binary export.
Is that a known issue ? Is there a workaround ?
TIA Loic
1 Correct answer
It's in your application folder -> scripts - > Export As Xhtml - > Start Up Scripts -> XHTMLExportMenuItemLoader.jsx
It just shows one way of loading a bin file into session. You should be able to find more info on the forum with a search.
Copy link to clipboard
Copied
You can't load the script into session from a binary.
To do this, you need a "open" script with the session directive in the top, to load the binary script.
See the XHTML std. script from adobe (in the scripts folder)
--
Thomas B. Nielsen
http://www.lund-co.dk
Copy link to clipboard
Copied
Hi Thomas,
Thanks a lot for answering.
I can't find teh script you talk about. We bought and receive a digital version of the CS4 suite. I looked inside and there is no scripts folder containing any xhtml*.js.
I look around on the net with no more success. Is there any place I can catch it ?
Thanks a lot.
Loic
Copy link to clipboard
Copied
It's in your application folder -> scripts - > Export As Xhtml - > Start Up Scripts -> XHTMLExportMenuItemLoader.jsx
It just shows one way of loading a bin file into session. You should be able to find more info on the forum with a search.
Copy link to clipboard
Copied
Hi Thomas,
I finally got it on my side based on your first input. You were right, I use a doScript command and it runs as charm.
Just a bit pity that the user has to deal with two scripts rather tha one.
Thanks a lot.
Loic
Copy link to clipboard
Copied
Hi,
Last but not least,
Is there a way to get it working with a CS3 ?
TIA Loic
Copy link to clipboard
Copied
I use CS3, so yes.
Please post the code that is not working for you (just a minimal example of the load of a binary).
I use the following to load a binary:
var basePath = getScriptsFolderPath();
script = loadScript(basePath + 'folderInTheSameFolderAsTheLoadScript/myBinaryFile.jsxbin');
if(script != null && script1 != null) {
eval(script);
}
function loadScript (in_filename) {
var script = null;
var file = File(in_filename);
do {
if (! file.exists) {
break;
}
if (! file.open()) {
break;
}
script = file.read();
file.close();
} while (false);
return script;
}
function getScriptsFolderPath() {
var err;
try {
var script = app.activeScript;
} catch(err) {
var script = File(err.fileName);
}
return script.path + '/';
}
--
Thomas B. Nielsen
http://www.lund-co.dk
Copy link to clipboard
Copied
Hi Thomas,
Thanks for your concern.
The code I use is very basic compared to your :-S
Here it is :
//Launching quickOpener.jsx
//quickOpenerWindow.jsxbin as you may guess is the binary file
#targetengine session
app.doScript(File(app.activeScript.path+'/quickOpenerWindow.jsxbin'));
Thanks for your help. I am trying your code right now.
Loic
Copy link to clipboard
Copied
It works nice, thanks a lot.
Loic
Copy link to clipboard
Copied
Hi,
Thanks to Thomas B. Nielsen, I have been able to launch a binary script in a #targetengine session environment.
However, there is a little thing I would to know if there is a fix.
Right now, I have two scripts. The launcher and the binary code which is called by the launcher.
I am used to create an alias of the launcher in the startup script folder and everything works like a charm.
The matter is that I have one user that puts the two scripts itselves in this folder. In this situation, the binary window is drawn but clicking any of its items throws an error 30476 : the object doesn't exists anymore.
It's not big deal if I can't find a solution as the script works well with aliases but just to not die dumb...
TIA Loic
Copy link to clipboard
Copied
In the binary, check $.engineName . Only if it is not "main" do your thing.
Dirk
Copy link to clipboard
Copied
Hi Dick,
One more good answer to your credit !
I had to deal first with the shift click matter before but now I have time to check your input and it works fine.
Thanks for all your care and share 😄
Bye Loic

