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

[JS] ScriptUI window unefficient in binary mode :-(

People's Champ ,
Nov 02, 2009 Nov 02, 2009

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

TOPICS
Scripting
1.5K
Translate
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

Engaged , Nov 02, 2009 Nov 02, 2009

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.

Translate
Engaged ,
Nov 02, 2009 Nov 02, 2009

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

Translate
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
People's Champ ,
Nov 02, 2009 Nov 02, 2009

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

Translate
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
Engaged ,
Nov 02, 2009 Nov 02, 2009

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.

Translate
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
People's Champ ,
Nov 02, 2009 Nov 02, 2009

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

Translate
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
People's Champ ,
Nov 03, 2009 Nov 03, 2009

Hi,

Last but not least,

Is there a way to get it working with a CS3 ?

TIA Loic

Translate
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
Engaged ,
Nov 03, 2009 Nov 03, 2009

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

Translate
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
People's Champ ,
Nov 03, 2009 Nov 03, 2009

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

Translate
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
People's Champ ,
Nov 03, 2009 Nov 03, 2009

It works nice, thanks a lot.

Loic

Translate
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
People's Champ ,
Nov 23, 2009 Nov 23, 2009

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

Translate
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
Guide ,
Nov 23, 2009 Nov 23, 2009

In the binary, check $.engineName . Only if it is not "main" do your thing.

Dirk

Translate
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
People's Champ ,
Nov 23, 2009 Nov 23, 2009
LATEST

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

Translate
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