InDesign scripting : lesson 29

the original version of this script was created, like so many scripts, in response to a problem. a necessary third-party export plugin was changing InDesign’s colour settings to a default custom set whenever it was used.

obviously, this is not an ideal situation for a colour-managed workflow and required each user to manually change the settings back every time the plug-in was run. needless to say, sometimes a user forgot to do this.

ordinarily, a script is not going to be of much use in this situation, because the user still needs to remember to run it. but this one takes advantage of yet another handy scripting feature supported by InDesign — the startup script. as you can probably guess, a startup script runs automatically whenever InDesign starts up — not an absolutely perfect solution to this problem, but at least a useful safeguard.

the structure of the script itself is quite simple :

tell application id "com.adobe.InDesign"
  set CMS settings of color settings to "macgrunt colour settings"
end tell

well, having gone that far, why not also reset a couple of other things, that might be periodically changed during the day, back to your preferred defaults at the start of the next day? this version of the script also resets some display preferences and the workspace :

tell application id "com.adobe.InDesign"
  set CMS settings of color settings to "macgrunt colour settings"
  set properties of display settings to {raster:proxy, vector:high resolution, transparency:medium quality}
  -- thanks to milligramme — adobe forums
  do script "app.applyWorkspace('macgrunt');" language javascript
end tell

that last command is an interesting one. if you look at the scripting dictionary for InDesign, you’ll see there’s an apply workspace command specified for applescript. problem is, it doesn’t work. but, as shown above, it’s possible to call the equivalent javascript using the do script command.

the finished compiled script looks like this :
screen grab of reset settings script

of course, you would need to substitute your own colour settings and workspace names.

well, that’s all very interesting, but how do you make this thing run every time InDesign starts up? rather than the scripts panel folder — just save it using the script file format into this folder :
Applications > Adobe InDesign CS6 > Scripts > startup scripts

what other things could you use a startup script for to help make your day a little easier?

macgrunt icon

InDesign tip : #29

adobe’s prerelease program is a brilliant way to contribute to the development of future software releases. this is what adobe has to say about the program :

“The goal of a Prerelease Program at Adobe is to solicit early feedback on new features and bugs in order to produce a unique and a bug free product that can deliver maximum results.”

it’s not something you can just sign up for — you have to apply, giving your areas of expertise, years of experience, etc. and if adobe think you may have something to contribute you’re in. you can apply to be part of adobe’s prerelease program here

if you get accepted into the program you get a sneak-preview of some of the cool stuff currently in development — some of it is just tweaks to existing tools — some of it doesn’t make the cut because it just doesn’t work, or whatever — but some of it is truly awesome — like this new menu that’s in the very early stages of development :
screen grab of beta design menu
(apologies, the conditions of the prerelease program forbid showing screen grabs of the actual functionality)

the top few menu items are pretty clunky at this early stage and will probably only be useful to talentless desktop publishers in the first few incarnations of this menu. but the basic concept is sound and there’s already quite a bit of evidence from the beta-testing that one day these will be really powerful features of InDesign.

the last two menu items are the ones with immediate application for designers. as you can probably guess, these allow for quickly testing different colour sets and font sets throughout a document. these rely on the user correctly assigning swatches and type styles onto which the test colours and fonts can be temporarily mapped. if you’re happy with the results, just confirm your choice and all your swatches and/or type styles are updated accordingly. a cool thing about this functionality is the capability to switch between up to three different colour sets and font sets — giving you all the experimental scope you need.

adobe keep things pretty tight, so it’s hard to know if this menu will make the cut for CS7. there is a positive vibe on the review forums, but there’s also a lot of concern about some of the more obvious bugginess — so it might be a bit longer before we see this menu released for real.

if you’re excited by this kind of future functionality, then you’re exactly the kind of person that adobe needs to help with testing and reviewing. so apply for the prerelease program and have your say.

keep grunting

macgrunt icon