Highlighted

ExtendScript asynchronous

New Here ,
Jul 21, 2020

Copy link to clipboard

Copied

Hi,

 

I am developing a small ExtendScript extension for FrameMaker and I need to periodically check a service. As I see, there is no setTimeout/setInterval implementation available, so from ExtendScript that is not possible to implement a non-blocking wait cycle. 1) Am i right? Or is there any workaround that I haven't found yet? 

2) I also saw that you can subscribe for idle task in InDesign. I wonder if there is any similar function to subscribe to the main loop in FrameMaker?

3) If none of above exists, my final idea for the problem is to start a script in Framemaker from outside (command line). Is there any solution for this?

Thanks in advance!

 

Best regards,

Balazs

TOPICS
Scripting

Views

46

Likes

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

ExtendScript asynchronous

New Here ,
Jul 21, 2020

Copy link to clipboard

Copied

Hi,

 

I am developing a small ExtendScript extension for FrameMaker and I need to periodically check a service. As I see, there is no setTimeout/setInterval implementation available, so from ExtendScript that is not possible to implement a non-blocking wait cycle. 1) Am i right? Or is there any workaround that I haven't found yet? 

2) I also saw that you can subscribe for idle task in InDesign. I wonder if there is any similar function to subscribe to the main loop in FrameMaker?

3) If none of above exists, my final idea for the problem is to start a script in Framemaker from outside (command line). Is there any solution for this?

Thanks in advance!

 

Best regards,

Balazs

TOPICS
Scripting

Views

47

Likes

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
Jul 21, 2020 0
Explorer ,
Jul 23, 2020

Copy link to clipboard

Copied

There is no async capability at all in FrameMaker or ExtendScript.

You can do a wait with $.sleep() but this is blocking.

 

There is an event loop in FrameMaker though, which can be used to trigger code based on the user (or another plugin) triggering certain events. Look into the Notification() and Notify() functions.

There is not a lot of info in the scripting guide on this, but if you look at the same functions in the FDK documentation, there is a decent overview of how the notification system works.

Likes

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
Reply
Loading...
Jul 23, 2020 0
New Here ,
Jul 28, 2020

Copy link to clipboard

Copied

1) Thanks, for confirmation

2) Yes, but can i use that loop to periodically check something? As you said, i can subscribe for specific events, but as i see there is no option to receive a notification in every 5-15-30 sec?

 

Likes

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
Reply
Loading...
Jul 28, 2020 0