hanamura / grunt-extendscript

Execute ExtendScript (.jsx) files.
MIT License
13 stars 2 forks source link

Windows support or would this work on Windows? #1

Open daluu opened 9 years ago

daluu commented 9 years ago

Looking through https://github.com/hanamura/grunt-extendscript/blob/master/tasks/extendscript.js

It would appear this project is targeted for Mac OS X? Any thoughts on whether this could be easily adapted to run for Windows via node.js/grunt on Windows (assuming grunt can run under Windows).

I'll investigate myself if I have some time to do so, and offer pull request if I can come up with something.

bastienEichenberger commented 9 years ago

Hi, I don't know if its help you but I'm writting a library in extendscript. I used grunt-extendscript as example. https://github.com/bastienEichenberger/extendscript-library/blob/master/tests/tasks/extendscript.js

The only problem that I didnt solve: I cannot choose witch software grunt must used: CC, CS6. Set app = CreateObject("InDesign.Application") // add a version here

I few weeks ago I added a support for windows and It works not so bad. I you have a better idea to do it let me know.

Have a nice day

daluu commented 9 years ago

Thanks for the info/tip bastienEichenberger.

As for selecting app version, I believe that's possible, at least for Adobe Illustrator. I'm assuming it would be same for InDesign. The snippet below is pulled from Illustrator CS5 Scripting Guide, you can confirm similar for InDesign scripting guide.

CreateObject launches Illustrator as an invisible application if it is not already running. If Illustrator is launched as an invisible application you must manually activate the application to make it visible:

Set appRef = CreateObject("Illustrator.Application")

If you have multiple versions of Illustrator installed on the same machine and use the CreateObject method to obtain an application reference, using "Illustrator.Application" creates a reference to the latest Illustrator version. To specifically target an earlier version, use a version identifier at the end of the string:

For Illustrator 10, use "Illustrator.Application.1" For Illustrator CS, use "Illustrator.Application.2" For Illustrator CS2, use "Illustrator.Application.3" For Illustrator CS3, use "Illustrator.Application.4" For Illustrator CS4, use "Illustrator.Application.CS4" For Illustrator CS5, use "Illustrator.Application.CS5"

I'm assuming suffixes for versions CC is ".CC" and CS6 is ".CS6"

bastienEichenberger commented 9 years ago

Hi, Thanks for the information. I added a commit and the scripts works correctly on windows. But only InDesign works if I add a version: Photoshop.Application.CC.2014 // do not work InDesign.Application.CC.2014 // OK Let me know if you find something…