Skip to main content
Known Participant
February 22, 2018
Answered

FrameMaker UI freezing while script is running

  • February 22, 2018
  • 2 replies
  • 1011 views

Hello guys,

I have a couple of questions for you.

When I am running my script, the script is actually working correctly in the background, but the FrameMaker UI is freezing and not reacting until the script is being shut down.

First question: How can this strange behavior be imrpoved?

Second question: How can I tell FrameMaker that a certain script must always be started when FM is starting (Autorun)?

Thanks a lot!


Selim

This topic has been closed for replies.
Correct answer Klaus Göbel

Not exactly.


Script A is the main routine, starting my socket etc. In Script B, C ,D, E there are only several functions to be called by script A. I "outsourced" functions depending on their logical purpose to various files, e.g.
Functions creating socket and establishing connection: "socket.jsx"
Functions for rendering .mif files: "docRenderer.jsx"
Functions for for parsing XML-Files: "XMLParser.jsx"

These files are included in the main.jsx like

#target "FrameMaker-14.0"

#include "B.jsx"

#include "C.jsx";

#include "D.jsx";

#include "E.jsx";


If they are included in your main script, you can call these functions.

If you want to call an external script you can call it like this:

var MyScript  = MyFolder  + "\\" + "ScriptA.jsx;

var RunFile = new File(MyScript);

$.evalFile(RunFile);

2 replies

Ian Proudfoot
Legend
February 22, 2018

Hello Selim,

The FrameMaker UI freezing whilst running a script is unfortunately normal behaviour. FrameMaker 2017 seems to suffer from it more than earlier versions. I have tried various ways to prevent it, but the usual side-effect is to degrade the script's performance. For one of my scripts I wanted to write processing messages to the status bar, but after the first message the screen freezes and no status messages are shown until the script completes.

If you add a script to the startup folder in FrameMaker's installation folder it will run as soon as FrameMaker starts. You may have to change the security settings for the startup folder as it is read-only by default. <drive>:\Users\<username>\AppData\Roaming\Adobe\FrameMaker\<version>\startup

I hope that helps?

Ian

Klaus Göbel
Legend
February 22, 2018

Hi Selim

to start a script when FM st started, copy it to

C:\Users\YOURUSERNAME\AppData\Roaming\Adobe\FrameMaker\14\startup

When I am running my script, the script is actually working correctly in the background, but the FrameMaker UI is freezing and not reacting until the script is being shut down.

That is normal, that it freezes until the script is finished.

My workaraound is, that I show a "personal console", where all the steps of the script is displayed, so the user is informed.

The second way is  to set app.Displaying = 0, and after the script is finished set app.Displaying = 1;

But there are some things to consider. Use the find function here in the forum to find some threads with  "app.Displaying".

selimc777Author
Known Participant
February 22, 2018

Hi Klaus,

thanks for your answer. I have 5 .jsx files, all of them are needed to run my script correctly. The script is loaded in one file I called "main.jsx". I need the other 4 files to run the script, but how can I tell FM, that "main.jsx" is to be started only?

Thanks!

PS: Thank you too Ian, as I mentioned now, I have problems regarding multiple files being added to this folder. Maybe you know a solution for this too?

Klaus Göbel
Legend
February 22, 2018

If I understand it right:

1. You have a script A

2. You have 2 other scripts B,C,D,E

Scripts B,C,D,E should be able to call script A?