InDesign tip : #34

sometimes things go awry with InDesign and it behaves abominably. sometimes things go even more awry and you can no longer open the application at all. these are the times to trash your preferences. but sometimes even this doesn’t work — and that’s what we’re going to cover in this post.

but first — trashing preferences. the best way to do this is to manually remove two files (if it’s running, quit InDesign to do this). both of these can be found in the user ‘Library’ which is, in recent versions of OSX, a hidden folder which does not normally show up in the Finder’s Go menu. but if you click Go and then hold down the option key — you’ll see Library get added to the list :
two version of the Finder's Go menu.

once inside the library folder, navigate to and delete these two files (after making a backup copy somewhere) :
> Preferences > Adobe InDesign > [version number] > [language] > InDesign Defaults
> Caches > Adobe InDesign > [version number] > [language] > InDesign SavedData

unfortunately, deleting those two files will also delete handy things like print and document presets and whatnot (luckily, things like workspaces, customised keyboard shortcuts, and PDF presets are not lost) BUT it will fix InDesign in the overwhelming majority of cases.

sometimes however this DOES NOT work and InDesign will continue to crash when attempting to start up. this may be caused by some recalcitrant recovery data. so the next thing to try is deleting this folder — also in the caches folder (again, after making a handy backup copy somewhere) :
> Caches > Adobe InDesign > [version number] > [language] > InDesign Recovery >

but once in a purple-polka-dotted moon you may find that EVEN THIS DOES NOT WORK. then it’s time to get radical and delete everything else inside that last level of the caches folder (again, after … you know the score):
> Caches > Adobe InDesign > [version number] > [language] >

if even THAT doesn’t work then … well … you’re on your own. sorry.

macgrunt icon

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 scripting : lesson 07

here’s a simple one-lesson script before we start on a series of lessons about exporting PDFs. sometimes it’s handy to be able to toggle between different preference settings: measurement units; dictionaries; keyboard increments; or, in this case, vector display. most of the time it’s better to display vector images as high res, because the proxy vector preview is truly atrocious. but your screen redraw time gets really bogged down for files which have too many vector images — so then it’s better to set it back to proxy. here’s a basic if/then script to toggle between the two preferences :

tell application "Adobe InDesign CS4"
    if (vector of display settings) contains proxy then
        set properties of display settings to {vector:high resolution}
        set properties of display settings to {vector:proxy}
    end if
end tell

this is the simplest form of toggle — two possible states, check which one is current then switch to the other.

the real purpose of this lesson is to have another look at the InDesign applescript dictionary first discussed in lesson 02. this is an example of how sometimes it may take a little digging around to find the exact terminology you’re looking for.

if you have a look at your InDesign preferences you’ll find that the vector view settings are managed from the ‘display performance’ window :

screen grab of display performance preferences window

that seems like a logical place to start searching the dictionary. but if you search for “display performance” you’ll get something like this :

screen grab of display performance entry in applescript library

… not very helpful. no mention at all of how to display vector images. bugger. InDesign has excellent applescript support. that is, there aren’t too many InDesign commands that can’t be performed through scripting. BUT the documentation — the dictionary — could be structured a leetle bit more closely to the user interface.

anyway, that’s just the way it is — so, maybe try “vector” :

screen grab of vector entry in applescript library

… ah, that’s better. here we can see an entry for “vector” as a property belonging to the “preferences suite”. and this is where we find out that if we want to change how vector art is previewed, we have to address display settings, not display performance.

luckily, this was an easy one. it’s not always so straightforward. but always remember, when things get difficult, google is your friend.

ok. now for your homework. how would you alter the script so that it toggles between all three vector display options?

macgrunt icon