JavaScript

Discuss scripting using AppleScript in QuarkXPress 2015, 2016, 2017 & 2018.
Discuss scripting using JavaScript in QuarkXPress 2018.
Post Reply
seneca
Posts: 0
Joined: 16 May 2018, 11:26

JavaScript

Post by seneca » 16 May 2018, 11:30

Are you going to publish JavaScript manual for QuarkXpress?
I can't find anything relating to that.

User avatar
franz.wohlkoenig
Posts: 1
Joined: 15 Jul 2014, 05:43
Location: Carinthia, Austria, Europe
Contact:

Re: JavaScript

Post by franz.wohlkoenig » 16 May 2018, 12:20

You mean something like https://github.com/qxpjs/ ?
27" iMac • 3,1 GHz Intel Core i5 • 12 GB Memory • System: macOS 10.13.5
XPress since 3.1, actual 2018

User avatar
MikeWenzloff
Posts: 344
Joined: 05 Jun 2013, 12:55

Re: JavaScript

Post by MikeWenzloff » 16 May 2018, 13:35

I suspect seneca doesn't mean the JS repository.

Real documentation of the DOM and samples tied to each element--what they and how they are used. Ya know, documentation! I need it and so does just about everyone else that is going to use JS in Q.

For now, this is the best I have found and can apply to Q2018, sans a published DOM.

https://developer.mozilla.org/en-US/doc ... xpressions

And while we're at it (the wanting/wishing part), Q needs to do what Adobe did with its ExtendScript. Much of what one can do in ID is directly tied to ES.

Mike

seneca
Posts: 0
Joined: 16 May 2018, 11:26

Re: JavaScript

Post by seneca » 16 May 2018, 14:28

Indeed.
The only way to see what's going on is to set breakpoints on running scripts and dig in.
All the JavaScript code used by Quark is in the QuarkXpress bundle. On macOSX right-mouse click on the application bundle to get into the folder. You should not find it too difficult to discover where it is.
Also, I can't see any UI elements except for JS prompt which is extremely basic.
I'm sure that in time this will improve or some folks will come up with some other ideas.
May we can employ Electron for that.
I suppose, we should treat the initial JavaScript support in Q18 as an early beta.

User avatar
Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2450
Joined: 04 Jun 2004, 15:06
Location: http://bit.ly/QuarkHamburg
Contact:

Re: JavaScript

Post by Matthias Guenther (Quark) » 16 May 2018, 16:17

Hi,

the JavaScript documentation is still in progress, it will appear soon on our documentation page.

We'll publish two documents, one API reference and one Scripting Guide.

Thanks
Matthias
Feel there should be more chatting, more tips, more user interaction?
Join us on Facebook, a forum-like group with over 2,000 QuarkXPress fans interacting:
http://www.facebook.com/groups/quarkxpress

Image

seneca
Posts: 0
Joined: 16 May 2018, 11:26

Re: JavaScript

Post by seneca » 16 May 2018, 17:28

That's great.
Thanks Matthias.

thoromyr
Posts: 0
Joined: 15 Jun 2016, 20:33

Re: JavaScript

Post by thoromyr » 29 May 2018, 06:39

Reviewing the scripts it appears that user interaction is extremely limited, e.g., getValidStringInput() and getValidNumericInput(). The sample script "Create Grid by Dividing a Box.js" requires bouncing through four dialogs which suggests that the API doesn't offer anything more sophisticated.

Is there any intention to provide a more functional dialog? Something along the lines of "new DialogWindow()" to which widgets (string inputs, combo boxes, etc.) can be added and their data collected (via something like promise) would go a long way toward making this usable.

User avatar
Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2450
Joined: 04 Jun 2004, 15:06
Location: http://bit.ly/QuarkHamburg
Contact:

Re: JavaScript

Post by Matthias Guenther (Quark) » 29 May 2018, 08:48

Hi Thoro,

yes, that's on the roadmap.

Thanks
Matthias
Feel there should be more chatting, more tips, more user interaction?
Join us on Facebook, a forum-like group with over 2,000 QuarkXPress fans interacting:
http://www.facebook.com/groups/quarkxpress

Image

User avatar
Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2450
Joined: 04 Jun 2004, 15:06
Location: http://bit.ly/QuarkHamburg
Contact:

Re: JavaScript

Post by Matthias Guenther (Quark) » 31 May 2018, 05:19

The JavaScript API documentation is now online:
http://www.quark.com/documentation/quar ... index.html

The JavaScript Scripting Guide is still in review and will appear soon.

Thanks
Matthias
Feel there should be more chatting, more tips, more user interaction?
Join us on Facebook, a forum-like group with over 2,000 QuarkXPress fans interacting:
http://www.facebook.com/groups/quarkxpress

Image

Post Reply

Return to “QuarkXPress 20xx: Scripting (AppleScript / JavaScript)”