Copy link to clipboard
Copied
Hello everyone! It's been a while since i posted here and the forum seems unrecognizable.
Anyway.. here is a plugin i wrote for running and partially debugging indesign scripts straight from Sublime text:
vamitul/RunInIndesign · GitHub
I know there are quite a lot of build systems for this already, but this plugin adds some very nice features:
Stuff to do:
That's about it, i guess. Download it, play with it, enjoy.
Ps. This is my first python project, i am just beginning to learn it, so go easy on me ![]()
Copy link to clipboard
Copied
Hi Vamitul,
This is an fantastic tool -- especially for those who think that Adobe has a thing or two to answer for (w.r.t to the ESTK editor). I've done just a couple of simple tests and it works very well and looks great.
Thanks very much for sharing. No doubt it will be a popular tool.
Peter
Copy link to clipboard
Copied
I was wondering if you were the same bloke ![]()
See sublimetext3 - Sublime Text Build For Executing Indesign .jsx Scripts on Windows - Stack Overflow for a bit of discussion on it.
The 1st windows build (the one in the question) which Vlad said there how to get it to work dose handle #target and #targetengine, $.writeln() get displayed in the ESTK and not the ST console which is a minus point compared to Vlad's version.
I was planning to get the $.writeln to write to the ST console and will take a look to see how it's done ![]()
By that link is a build for Macs.
I have a very good auto-complete for sublime text which I plan on putting out in about a months time.
I'll post a link here then.
Copy link to clipboard
Copied
I had a problem with my keyboard and it messed up the post above, in it's format and content, I corrected it now
Copy link to clipboard
Copied
Updated:
Now, if someone could help me with the proper visual basic application identifiers ( CreateObject("InDesign.Application.???????") ) it would be great:
{ "identifier": "",
"name": "(default)"
},
{
"identifier": "CS6",
"name": "CS6"
},
{
"identifier": "CC",
"name": "CC (x32)"
},
{
"identifier": "CC",
"name": "CC (x64)"
},
{
"identifier": "",
"name": "CC 2014 (x32)"
},
{
"identifier": "CC.2014",
"name": "CC 2014 (x64)"
}
Next stop: #targetengine support
Copy link to clipboard
Copied
Updated.
Added #targetengine support, plus some cosmetic changes
Next: minimal debugging support, by implementing $.bp() breakpoints
Copy link to clipboard
Copied
I have just added OSX compatibility. Seems to be working ok, but applescript is not my forte, so please test.
Copy link to clipboard
Copied
Thanks for doing this, Vamitul
MAC OSX 10.8 InDesign CS 5.5
I have to link to InDesign 5.5 after the error message, but after this it works.
Copy link to clipboard
Copied
I added CS5.5 to RunInIndesign.sublime-settings on my install to bypass the error. Is it going to be a problem? I do not see anything wrong so far.
Copy link to clipboard
Copied
nicolaik that is how you are supposed to do it ![]()
I didn't add it since i don't have CS 5.5 on my systems.
Copy link to clipboard
Copied
Vamitul,
AppleScript is compiled and decompiled for editing, unless you take care to store it in source code. The compiled form of 'tell application "xyz" ' will be translated into a form using the "creator code" that is the same for all versions of InDesign. Therefor all your carefully chosen version specific names in that "exists" test chain won't survive the roundtrip, as you also can see if you revisit the current source at github.
Instead of adressing InDesign by versioned name, you can use the "id" specifier form, which refers to the version independent "bundle id" and survives the roundtrip:
tell application id "com.adobe.indesign"
-- do your thing here
end tell
Copy link to clipboard
Copied
Thank you, DIrk.
I have to admit AppleScript doesn't make much sense to me, so all the code i did for the osxRun part of the plugin is crap at the least.
I noticed the stuff with the compilation, and that is why the plugin calls the already compiled script runJS.scpt instead of the source one.
My question is, if i switch to using bundle id, how can i target specific versions of indesign? Right now i have on my system 3 of them (cs6, cc and cc2014), and that is because it's a newly installed setup (on the windows machine i have everything from cs5 to current + indesign server). The whole point of those runner scripts are so the plugin can target different versions of indesign on the fly.
Copy link to clipboard
Copied
I haven't yet tried your Sublime plugin but assume that you try to mimic ESTK's target dropdown.
Before we get too deep into that problem - and I don't yet have the answer - I want to question whether it is worth the effort at all.
ESTK enumerates the ExtendScript target applications through some private registry of target names that include the version number, somewhere down in the guts of the "BridgeTalk" subsystem. For completeness sake you should actually also consider something similar, there are also ExtendScript scripters that will want to target InCopy, Illustrator, Bridge etc. My ESTK target dropdown right now has 31 entries, 3 of them InDesign versions CS5, 5.5 and 6 and that is on a machine without any CC.
It should also mention InDesign CS4 and Server CS4 which are still installed, but those installations are screwed up anyway, and ESTK is notorious in finding InDesign Server instances. Did you know you it is pretty usual to launch multiple InDesign Server instances in parallel processes?
Here's another problem: In ESTK the same versions are lumped together in one target id, so it is sheer luck whether ESTK launches the one you intended.In my case that could be the latest US English debug build of InDesign CS4, or either the English or German localization of CS5.5 ...
In other words, I also have multiple copies of InDesign, even with the same major version. Others will have MiddleEast versions installed in parallel.
Instead of bothering, I just launch the correct version myself. If you go the "id" way, the already running process is preferred. Unlike plugin programming with XCode where you have to restart the application for every other build of your executable plugin, this step is only needed once in a while.
If you want to continue with your choice UI, I'd first decide whether to use AppleScript at all - or use the command line of ESTK instead.
Then, the best test for installed applications - after a little google search - appears to be the command line util for launch services, as shown here:
http://sohu.io/questions/551731/enumerate-all-installed-applications-on-os-x
We'd then have to figure out how to run an application by posix path.
You can also enumerate the running applications (processes) via "System Events".
Copy link to clipboard
Copied
Btw, another program to play with is the command line "open".
See "man 1 open" for details.
Copy link to clipboard
Copied
Just a quick heads-up, the plugin is now available through the sublime package manager (Package Control - the Sublime Text package manager).
To install the plugin
1) install the package manager (if you don't have it already)
2) open it and look for Run in Indesign
Copy link to clipboard
Copied
Hi Vamitul,
Thank you for your impressive plugin!! I use it since 2 years.
Since, did you implement "$.bp() breakpoints" ?
Did you find a wait in order to debug directly from ST and not ExtendScript Toolkit?
And a way for see the "Data folding" (the panel in ExtendScript Toolkit, I'm not sure of the translation, "Navigateur de données" in French), and the "Javascript Console".
Thank you and have a good day!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more