Xmarks Top Site in Adobe Scripting


Archive for the ‘Freebies’ Category

ShowPaths 1.0 for Macintosh Released

Thursday, January 7th, 2010

ShowPaths for Macintosh is a very simple app, with only one purpose: give you easy copy/paste access to the file path of a file or folder.

It’s released as donationware.

Have a look here for the download link:

http://www.rorohiko.com/showpaths

TextExporter 2.1.3 Available

Sunday, January 3rd, 2010

TextExporter is a plug-in for InDesign CS, CS2, CS3 or CS4. It allows you to export all the text from an InDesign document concatenated into a single RTF file, while following a natural reading order. Text files and InDesign Tagged Text are also supported.

The latest version adds support for properly exporting the bullets or numbers that are created by using bulleted and numbered paragraph styles in InDesign – normally, these bullets vanish from the resulting RTF file when exported.

Read all about it at

http://www.rorohiko.com/wordpress/indesign-downloads/text-exporter/

How and why to use Script Labels in InDesign

Tuesday, November 17th, 2009

In this blog post, I want to talk a bit about the secretive Script Label in InDesign.

You might have noticed the Script Label palette, and wondered what it was used for – it’s under Windows – Automation – Script Label.

First I’ll explain what it is all about, and then I’ll dive into some practical scenarios to show you how you can use the Script Label to save lots of time. Most of the info in this blog post is applicable to Mac and Windows versions of InDesign CS, CS2, CS3 or CS4.

1. Big Word of the Day: Meta-Information

In most companies or institutions, ‘Adobe InDesign’ does not live on an island. It’s a cog in a bigger system.

There is a natural ‘flow’ of information throughout the company – orders or requests come in, and somewhere along the line, designers build or modify InDesign documents based on information they receive one way or another – a project brief, a meeting, an e-mail, a telephone call…

Then they pass the result of their work on to the next person or system down the line – as an InDesign file, an InCopy file, a PDF file, a web page, a stack of physical paper,…

In some companies, this flow of information is informal and unstructured.

In other companies (typically larger ones), the flow of information has more or less structure. There are rules and procedures and regulations. You’ll hear about things like ‘order forms’ or ‘job tickets’ or ‘job jackets’ being passed around.

Sometimes there are tangible envelopes or manilla folders with stuff in them, sometimes there is just electronic data being passed around via a central computer system…

In all this hustle and bustle, having a way to keep some tidbits of extra information about an InDesign document inside the document can come in very handy.

This extra info is not meant to be part of the printed end-result. Instead it provides you with critical info about the document: who is the customer? By when is it due? Who should you ring if you have questions? What inks can you use? What is the target resolution? How many pages can you have? And so on…

All such information is sometimes referred to as meta-information – it’s information about how to treat the information in the document.

Having the answers to questions like the ones above readily available ‘inside’ the InDesign document can make a world of difference. No need to ring around in order to figure something out if the info is right there for you to read, inside the document.

There are many ways to do this.

You might have a simple text frame out on the pasteboard with information typed into it. (On a related note – you might want to check out our free HistoryLog plug-in – it uses this idea to provide you with an automatic document history. http://www.rorohiko.com/wordpress/indesign-downloads/history-log/).

You might be using part of the document name to refer to the customer code or hold a deadline date (e.g. so you’d know that a document called RORO12_20091112.indd is related to customer code RORO12 and is due by 12-Nov-2009).

Meta-information is where the Script Label comes in handy: the Script Label is a convenient way to attach a little bit of text, any text, to a page item.

InDesign does not care what text you attach. Whatever you put into the script label won’t normally affect the output of your document – but it’ll keep the text with the page item.

2. Practical Use of the Script Label

Some people use the Script Label to tag page items for automated processing by a script – hence its name ‘Script Label’: it is very often used by script developers.

However, it is not limited to just that. Your imagination is the limit.

I’ve made up a sample scenario here – read it, and that might give you some new ideas. I’ve called this scenario ‘the todo-list-scenario’.

There’s some scripting involved, but you don’t need any scripting knowledge to make use of it – if you can follow instructions, you should be able to make this work.

The problem: imagine I have a spread with heaps of text frames, and all of these page items need to be inspected. Some of them need to be modified depending on what I find.

Suppose all these text frames contain customer comments for the Playamathing toy, and they might or might not contain a reference to a color.

There’s a frame that contains the text “I really love the red Playamathing”. Another says “The yellow Playamathing with the extra knobs is my favourite”, and so on… Imagine there are hundreds of those frames, scattered all over the layout in a fairly haphazard layout.

My task is to read all these bits of text, and change the background of the frames to match the color mentioned, if there is one. If no color is mentioned, I am to leave the background white.

How do I keep track of which ones I’ve inspected and which ones I still need to do? Script Label to the rescue!

2.1 Marking page items with a script label

First of all, I select all text frames. Then I bring up the Script Label palette and type ‘TODO’ in it. Then I click somewhere in the pasteboard area. Through that simple manipulation, I’ve now ‘marked’ all selected text frames with a script label ‘TODO’.

snap1

I now keep the Script Label palette open, and each time I finish one of the text frames, I simply remove the ‘TODO’ from the script label for that text frame.

snap2

2.2 Using Scripts

This approach is still rather cumbersome, and we’ll improve it through a few simple scripts and keyboard shortcuts. Here’s how!

Open a text editor. You could use Notepad on Windows, or TextWrangler (http://www.barebones.com) on Mac.

Don’t use the Apple-provided TextEditor – it will try to save your script in RTF format instead of plain text, and then it won’t work.

Tip: if you’re really in a bind, Stickies (the sticky-note app that comes with Mac OS X) works better than TextEditor when it comes to creating plain text files.

Type the following text into a new text file:

app.selection[0].label = "TODO";

This is a one-line script. There are a few small ‘gotchas’, and I’ll discuss those later, but it’ll do.

Save the one-line text document into a file called mark_todo.jsx

Make sure the file extension is .jsx, not something else. It’s easy to accidentally create a file called mark_todo.jsx.txt (with an extra .txt file name extension). To compound that problem, the Windows Explorer or Mac Finder are often configured to not show the final .txt, and hence such a file might look OK, yet refuse to work. Be aware that what looks like a .jsx file might not be one.

Now, store this mark_todo.jsx file in the InDesign Scripts – Scripts Panels folder. Go to your InDesign application folder, then into Scripts, then into Scripts Panels. Put the mark_todo.jsx file there.

(A method to quickly get to the Scripts Panel folder is to right-click or control-click the Application folder on the Scripts Palette in InDesign and then select Reveal in Finder or Reveal in Explorer).

snap3

Now duplicate mark_todo.jsx file, and rename the duplicated file to unmark_todo.jsx. Then open unmark_todo.jsx in your text editor and eliminate the four letters of TODO, so it reads:

app.selection[0].label = "";

snap3a

Go back to InDesign. On the Scripts Palette in InDesign, when you double-click either mark_todo.jsx or unmark_todo.jsx, they will look at the current selection, then take the very first item in that selection, and adjust the script label of that item to either be TODO or nothing.

These two scripts have some limitations, as you’ll find out. Try this: make sure no page item is selected and then double-click either one of them on the scripts palette.

blog_scriptlabel_errormessage

You get a nice big fat error dialog: the script is trying to access part of ‘the selection’ and nothing is selected, so InDesign is a little bit unhappy about that.

Not to worry! You can safely ignore this – nothing bad has happened. We’ll just live with that behavior for now – simply keep in mind that you must have a single item selected before running either script.

2.3 Using Keyboard Shortcuts

The next step is to assign some keyboard shortcuts to these two scripts. Go to Edit – Keyboard Shortcuts, and create a new set if necessary – I created a set called Todo Script Set. Go into the Product Area Scripts, and then assign shortcuts to the two scripts – on my Mac, I’ve assigned them Ctrl+T and Ctrl+U. On Windows you might want to pick some other shortcuts – pick something that works for you.

blog_scriptlabel_keyboardshortcuts

The scripts palette should now show these shortcuts next to the scripts. Bring the Script Label palette into view, select a page item and repeatedly hit Ctrl+T followed by Ctrl+U while observing the Script Label palette. The word TODO should appear and disappear from the Script Label palette each time you hit the shortcut.

That’s another step in the right direction – marking and unmarking individual page items just became a whole lot easier.

2.4 Finding marked items

Now the next question is: how to quickly find page items that still have a ‘TODO’ script label? Sadly enough the standard ‘Find’ function in InDesign does not seem to be of much help.

Scripting to the rescue! Below a script that finds the next item with a ‘TODO’ script label.

do
{
  if (app.documents.length == 0)
  {
    break;
  }

  var document = app.activeDocument;
  if (! (document instanceof Document))
  {
    break;
  }

  var currentItem = null;
  if (app.selection.length > 0)
  {
    currentItem = app.selection[0];
  }

  var undoneItems = [];
  for (var idx = 0; idx < document.allPageItems.length; idx++)
  {
    var pageItem = document.allPageItems[idx];
    if (pageItem.label == "TODO")
    {
      undoneItems.push(pageItem);
    }
  }
  if (undoneItems.length <= 0)
  {
    break;
  }

  var nextItemIdx = 0;

  if (currentItem != null)
  {
    var currentItemIdx = -1;
    var searchItemIdx = 0;
    while (currentItemIdx == -1 && searchItemIdx < undoneItems.length)
    {
       if (undoneItems[searchItemIdx] == currentItem)
       {
         currentItemIdx = searchItemIdx;
       }
       searchItemIdx++;
    }
    if (currentItemIdx >= 0)
    {
      nextItemIdx = currentItemIdx + 1;
      if (nextItemIdx >= undoneItems.length)
      {
        nextItemIdx = 0;
      }
    }
  }

  app.select(undoneItems[nextItemIdx]);
}
while (false);

I won’t elaborate on how this script works – if you’ve done some ExtendScript-ing before it should be fairly easy to follow. If you’re new to ExtendScript – simply make sure you copy the script verbatim.

Save this script to your Scripts Panel folder as next_todo.jsx.

Each time you double-click this script, the currently selected item will ‘jump’ to the next item that still has a TODO label. You can assign another shortcut key to this script – I used Ctrl+N on my Mac. Each time I hit Ctrl+N, my selection jumps to the next page item with a TODO label.

2.5 Seeing Marked Items

We’re not done yet! If you install our FrameReporter plug-in (http://www.rorohiko.com/framereporter) you can configure it to visually show the script labels. With FrameReporter active, and configured like this:

Screen shot 2009-11-18 at 3.26.27 PM

I can do Select All on my spread, and I get to see this:

Screen shot 2009-11-18 at 3.29.23 PM

I can immediately see that two of the three items still haven’t been examined. Unlike most of our plug-ins, FrameReporter is not a freebie, but it’s still a steal at just US$29.

2.6 InDesign CS4 Live Preflight

But wait, there is more! Soon, we’ll have the YeShore plug-in available which extends the InDesign CS4 Live Preflight (http://www.rorohiko.com/wordpress/yeshore). It has a number of powerful new preflight rules, one of which involves script labels.

If you have YeShore installed (e.g. because you’re on our beta program – check the web page to find out more), you can configure a rule to find all unfinished page items:

Screen shot 2009-11-18 at 3.34.43 PM

I’ve made a preflight profile called ‘Check all done’ and added a rule that says that the script label should not be TODO. With this profile active, it becomes very easy to see how many items I still have to handle, and to ‘hop’ to any items that are still marked as TODO. I simply click on one of the lines in the Preflight panel and InDesign immediately selects the corresponding item.

Screen shot 2009-11-18 at 3.37.12 PM3. Conclusion

I hope that these samples are useful! And if you’re interested, check out FrameReporter, or stay tuned to hear more about YeShore!

Cheers,

Kris

LayerLifter 1.0.1 Released – Adds Document-wide Layer Nudging And Shifting.

Thursday, October 29th, 2009

Our LayerLifter freebie is a simple plug-in for Adobe InDesign that offers an alternative method for moving page items between layers, instead of using the InDesign Layers palette.

With LayerLifter, the names of the document layers appear in the context menu of any selected page item. You can move a page item between layers by right-clicking and selecting a layer name from the context menu.

This updated version adds an optional feature to nudge all items on a layer throughout the whole document, or across the current spread – only users that have a license for APID ToolAssistant installed have access to this optional feature.

To see a little bit more about this new feature, check this out – it’s a little article that explains how to nudge a whole collection of frames in one swoop:

http://www.rorohiko.com/wordpress/2009/10/29/how-to-nudge-and-shift-a-whole-layer/

More info about LayerLifter can be found here:

http://www.rorohiko.com/layerlifter

ImageLibraryLoader 1.0.6 Released

Thursday, October 29th, 2009

ImageLibraryLoader 1.0.6 fixes an issue that occurs when you try to paste from an InDesign library into the same frame a second time – the second paste did not work with the previous version. This version fixes that issue.

ImageLibraryLoader is a free plug-in for InDesign allows you to quickly set up a floating palette filled with images from one or more designated folders. In many cases, it is much faster than Adobe Bridge, as it uses standard InDesign library palette – so there is no external app to launch.

ImageLibraryLoader and ImageHorn, another free plug-in we have on offer, work great as a combo – read all about it in this post:

How to Populate a Template With Images in No Time At All

TextExporter 2.0.8 available

Friday, October 9th, 2009

Our ever more popular TextExporter tool has had a face-lift. TextExporter is a free plug-in for Adobe InCopy and Adobe InDesign that allows you to export all text from an InDesign file to a single file – in either Text, RTF or InDesign Tagged Text format

Yes, you read that right – you can use TextExporter with InCopy as well as with InDesign!

For users of CS3 and above, this latest version has an improved method for concatenating the InDesign content into a single RTF document. As a result the RTF export has better fidelity for users of CS3 and CS4. It’s still very much WYSSRWG (What You See Somewhat Resembles What You Get) but generally speaking, it’ll look closer to the original.

Furthermore, for those people who have (or will have) purchased the optional US$25 license for APID ToolAssistant, there are two additional features.

First of all, you can opt to export an InDesign document in frame-by-frame order instead of the default story-by-story order, so for some documents, the resulting RTF export file can be visually a bit closer to the original layout.

Secondly, you can convert all text to black during export – which is helpful when the InDesign document contains white text above a dark backdrop. Such white text becomes normally invisible in the exported RTF file, but with this new option, that’s a problem of the past.

Screen shot 2009-10-10 at 9.49.47 AM

More info and download links can be found by clicking here:

http://www.rorohiko.com/textexporter

ImageHorn and ImageLibraryLoader Updated

Wednesday, September 16th, 2009

ImageHorn is a free plug-in for Adobe InDesign to automatically resize or re-fit an image frame’s contents when the image frame is resized.

ImageHorn has a new feature – it is now possible to ‘pre-assign’ a fitting option to an empty frame (without any image). Later on, when an image is placed or pasted into the frame, the pre-assigned fitting option kicks in and will be applied to the image.

ImageLibraryLoader is another free plug-in. This one allows you to quickly set up a floating palette filled with images from one or more designated folders. In many cases, it is much faster than Adobe Bridge, as it uses standard InDesign library palette – so there is no external app to launch.

ImageLibraryLoader has been enhanced with a menu item that allows the user to directly paste a library item into an existing frame – which saves quite a few clicks.

There are a few limitations though – this new ImageLibraryLoader feature only works in Adobe InDesign CS3 or higher, and it only works for users that have a licensed version of APID ToolAssistant installed. Users of the free, unlicensed version of APID ToolAssistant miss out.

These two new features work great together – read all about it in this post:

How to Populate a Template With Images in No Time At All

How to Populate a Template With Images in No Time At All

Wednesday, September 16th, 2009

This short article will explain how you can set up a template with a bunch of image frames, and then populate this template with images, much faster than you’d expect, using Adobe InDesign CS3 or above.

The secret to this are two of our popular tools: ImageHorn and ImageLibraryLoader.

Both are free, but for maximum efficiency you will also want a licensed version (or a non-lapsed demo version) of our APID ToolAssistant plug-in installed.

That’s because the Paste Into Selected Frame feature of ImageLibraryLoader is only available for people that have a licensed APID ToolAssistant installed – that particular feature is not available if you are using the free, unlicensed version of APID ToolAssistant.

Now, it works fine without the Paste Into Selected Frame feature, but as you’ll see, having this feature allows you to save even more mouse clicks.

Here’s how it works: first you need to install the plug-ins (three in total – ImageHorn.spln, ImageLibraryLoader.spln, and an appropriate copy of the APID ToolAssistant plug-in).

Launch InDesign CS3 or above, and create a new document. Create a few empty image frames – something like this:

Picture 2

Now, select all the frames (hit Command-A or Control-A), and then select the API – ImageHorn – Dynamic Fill Proportionally menu item. This will ‘mark’ all page items to (re)apply a ‘Fill Proportionally’ each time any of these frames changes – for example, when an image is placed into a frame.

Picture 3

The next step: fill the ImageLibraryLoader palette with images – select the API – ImageLibraryLoader – Reload Image Library… menu item, then navigate to a folder with some images you want to use as content for this layout. The ImageLibraryLoader will ‘grab’ all of these images, and quickly build a little floating palette with them – many people prefer this approach to using Adobe Bridge.

Picture 4

Now the magic bit: select any one of the frames on the page, and also select any one of the images on the AutoImageLibrary palette. Then select the API – ImageLibraryLoader – Paste Into Selected Frame menu item. The image will be copied from the palette, straight into the frame, and then ImageHorn kicks in, and the placed image will be resized to fill the frame proportionally – all in one quick operation.

To make it really fast, you’d assign a keyboard shortcut to the Paste Into Selected Frame menu item. Click-click-tap, done!

Picture 8

If you don’t have a licensed version of APID ToolAssistant, you won’t be able to use the Paste Into Selected Frame menu item. In that case you need a few more clicks to achieve the same effect. Drag the desired image from the AutoImageLibrary palette onto your pasteboard. This creates a new frame with the image inside it. Next, use the direct selection tool (hollow arrow) to select the frame content. Cut, and then Paste Into the destination frame. Delete the remaining empty frame from your pasteboard.

Of course, this trick is no panacea: it all depends on your workflow whether this approach is usable or not; in many cases, there are factors like image resolution to consider – but often, this is ‘good enough’.

Now, a bit more about APID ToolAssistant – it is a seemingly featureless plug-in, but it is actually a critical component for many popular plug-ins, and behind the screens it helps tools like ImageHorn and ImageLibraryLoader work their magic. APID ToolAssistant has two ‘modes’ – licensed and unlicensed.

When you install the downloadable demo of APID ToolAssistant for the very first time, it will work (for the purpose of demonstration) as a licensed version for about a month, and then it will fall back to the unlicensed mode.

If you’ve never installed APID ToolAssistant before, you’ll be able to try out the above trick during the demo period. On the other hand, if your demo version of APID ToolAssistant has already dropped back to unlicensed mode, you’ll need to shell out US$25 for a license before you can use the above trick.

Getting a license is easy – select the API – APID ToolAssistant… menu item. In the following dialog, click the line that says APID ToolAssistant and then click the Get License… button – you’ll be directed to a web page for purchase.

Picture 10

Follow the links below to read more about each of the three plug-ins:

APID ToolAssistant updated

Monday, September 14th, 2009

We’ve just released an update to the APID ToolAssistant plug-in – version 1.0.47.

This plug-in has no end-user features; it is mainly an invisible, yet critical component of many popular InDesign plug-ins, both developed by us or by other software developers.

As such, APID ToolAssistant provides support for many of our popular tools, like TextExporter, StoryParker, MagnetoGuides, FrameReporter

If you are using any tools that rely on APID ToolAssistant, please update to the latest and greatest. In the 1.0.47 release, we’ve concentrated on performance and stability. The few new features we’ve added are mainly of interest to software developers who use APID ToolAssistant as a component for their tools.

In our own range of tools, especially FrameReporter benefits from using the latest APID ToolAssistant – the little info-labels now remain better ‘attached’ to the associated frame, even when rotated or stretched, and APID ToolAssistant now avoids drawing information ‘upside-down’.

Click here for more info about APID ToolAssistant.

ImageHorn freebie has been updated

Friday, May 8th, 2009

ImageHorn for Adobe InDesign is a free plug-in designed to enable dynamic image fitting (‘horn’ like in ’shoehorn’).

Dynamic image fitting automatically re-applies the selected fitting settings to an image each time you resize the frame that contains it.

Version 1.0.1, our newest release, adds support for placed PDF and EPS files – the previous version only supported placed bitmap images.

David Blatner recently covered ImageHorn as one of 10 free must-have plug-ins on Lynda.com:

InDesign CS4: 10 Free Must-Have Plug-ins

Click here for more info about ImageHorn and the download links!