Skip to main content
Legend
March 2, 2024
Question

How to access ScriptLanguage.JAVASCRIPT values with AutoHotkey

  • March 2, 2024
  • 1 reply
  • 2455 views

I am trying to perform doScript using AutoHotkey and ComObject. In this case, arguments such as ScriptLanguage and UndoModes need to be specified.

 

Currently I directly write values such as 1246973031 (as ScriptLanguage.JAVASCRIPT). How do I write to get it from InDesign DOM?

 

Current code: 

app := ComObject("InDesign.Application.2024")
app.doScript("alert(0)", 1246973031, , 1699963733)

 

Ideal code: 

app := ComObject("InDesign.Application.2024")
app.doScript("alert(0)", ScriptLanguage.JAVASCRIPT, , UndoModes.ENTIRE_SCRIPT)

 

Environment: 

  • Windows 11
  • AutoHotkey 2.0
  • InDesign 2024 (19.2)
This topic has been closed for replies.

1 reply

m1b
Community Expert
Community Expert
March 2, 2024

Good question! Enums aren't children of the app, they are global objects, so another way to phrase it is: how do I access ExtendScript global objects from the app — ComObject("InDesign.Application.2024")?

 

@Robert at ID-Tasker any ideas?

 

My thought would be that you will have to re-define the enums in your script. Sorry I'm no help.

- Mark

sttk3Author
Legend
March 2, 2024

At this point, we are not yet in ExtendScript space and expect to have access to something like idScriptLanguage.idJavascript defined in ComObject space.

Community Expert
March 2, 2024

Did you check the tlb file with a tlb viewer it should provide some hints. Something on the app object

-Manan

-Manan