My Calendar Caffuffle

Around this time of year, I usually get into the festive season by offering a new script for readers of the website. This year, I intended to release a free script that would generate a year planner based on the calendar year, page size and school term dates. After a weekend or so, I’d managed to create a proof of principle script using a Native InDesign Dialog and used it in a live project. Here are some shots of the first iteration of the script, along with the output:

01oldUI

02oldresult

While the script worked, it was not perfect, given that there was no error correction for the date fields, so if values were entered into date fields that weren’t the correct date syntax, the script would return an error. It was at this moment in time that I’d realised something very important:

There’s a difference between Native InDesign Dialogs and ScriptUI

Gabe Harbs has a brilliant write-up about the differences on the InDesign Scripting forums but ultimately it meant that the script would not allow for error correction unless it was rewritten using ScriptUI, something I was hoping to avoid. I’ve begun the re-write of the script but have not proceeded to far as I’m encountering a few issues. Here’s what I have now:

03newUI

For now, that’s as far as the script has progressed, and this leads onto the second issue:

A busy work schedule that included Adobe MAX

IMAG0547

Between October to December is usually very busy as there is seasonal work such as school diaries, yearbooks and other collateral that is wanted by the end of the Australian school year. In addition to this influx of work, I also had the opportunity to attend Adobe MAX 2017 in Las Vegas, Nevada, USA.

During MAX, I’d informed several of my peers about the upcoming script that I’d planned on releasing, only to realise the following:

Schools years, terms and holidays differ between countries

In Australia, the school year starts towards the end of January and ends at the in the second or third week of December. There are four terms and each state has their own term dates. Within this structure, private schools can also set their own dates, and this usually varies by a week or so of the Government schools. Given that I live in Australia, I’d created the script for use within the rules that apply for Australia.

However, I’d neglected the fact that users in the northern hemisphere have a completely different school year that starts in one calendar year and finishes in the next calendar year. This rendered my script of little to no use to most InDesign users, so for now the script sits on the shelf waiting for a quieter time before I revisit the idea.

I won’t leave you empty-handed!

Despite these setbacks, I still have a festive season gift to bestow: A day to a page planner script. Upon running this script, the user is asked for a start and end date range in ISO date format. When an appropriate date range is chosen and the OK button is clicked, a new InDesign document is made, creating threaded frames that contain a day to a page that contains the correct date.

04dotwmaker

05dotwmakerresult

The script can be downloaded from the downloads page of Colecandoo.

If you are interested in the year planner project discussed in this article, feel free to contact me via my contact page.

Check out the Youtube videos too!

Since 2015, I’ve also been preparing a series of short videos on Youtube that complement the articles already on the Colecandoo website. I plan to release more videos and if you haven’t seen the channel, check it out here.

 

Advertisements

Data Merge to Unique Names script updated for ID CC 2018

Just a quick note that if you are a user of the Data Merge to Unique Names script, please note that the script has been updated for InDesign CC 2018. If you have not downloaded the latest version, please do so from the downloads page.

The update fixes a bug that would prevent merging to InDesign files due to a packaging issue. That said, make sure to read the instructions prior to use, particularly if using fonts that are dependent on a Document fonts folder for font usage in the file.

Of interest: New Data Merge techniques and quote bug

In the latest Colecandoo Youtube episode, four Data Merge specific features are covered, namely:

  • Adding faux-returns to a data merge field to split over lines, and subsequent limitations of this technique;
  • Using GREP styles to swap a character for a glyph during a Data Merge;
  • Highlighting field codes so that they are easier to see when not showing live data; and
  • A bug that occurs when a double-quote is at the start of any field in a Data Merge text file.

Faux returns within a field

The faux-returns technique is written about elsewhere, so rather than spoil their presentations, please read the articles directly from the appropriate sources:

I’m a fan of this trick, but emphasise that this is a workaround rather than a long-term solution, given that formatting is limited and there are more appropriate ways of accomplishing this task such as dedicated plug-ins or an XML workflow.

Swap characters for glyphs

Daniel Solis also features a clever trick to swap phrases with glyphs during a Data Merge that uses both GREP styles and ligatures. Again, rather than simply repeat the technique, please see his original video here.

A similar method can be employed using Indiscripts’ Indyfont script, but rather than swapping phrases with glyphs, will swap single characters.

Highlight Field Codes

The video also shows a method for highlighting field-codes when Data Merge is not in the preview mode. It relies on the [Basic Paragraph] style using a GREP style that contains a large highlight, and that any other styles in the document are based off of the [Basic Paragraph] style. It also means the document has to be styled correctly.

I’d demonstrated this technique following a real-world example of a live file where fields were very hard to see, and the file had to have an offset shell printed with variable data printed afterwards, so making sure the shell had no variable data on it was crucial. Using this technique would make finding the field codes much easier to see.

Double Quote bug

Also featured in the video was an issue that once again arose from a real-world example where a customer had provided a database that had double-quotes at the beginning of fields, but no closing quotes, resulting in rather unusual results.

 

Housekeeping Scripts

You finally have an approval on that print project you’ve been working on for the last few months. All that’s left to do is make a PDF for the printer and be done with it, right?

Nope. It’s time to do some housekeeping on the file. Let me use this metaphor, once you’ve made dinner, you don’t leave your dirty pots and pans in the sink, do you?

It’s time to do some housekeeping, and in this episode of “must haves” on the Colecandoo Youtube channel, we’ll look at several scripts to keep your files nice and tidy.

Disclaimer

One word of caution with any of the scripts shown in the video. They are all destructive in nature. That is, they intentionally remove items from a document. Make sure you save your work prior to running these scripts, just in case they have a catastrophic impact on your artwork. I’m showing these scripts for educational purposes only, this is not a tutorial on how to use these scripts.

Images and Frames

Cleanup Pasteboard

The first script removes items from the pasteboard. Run the script and select the distance from the trim edge and importantly whether threaded text on the pasteboard should be removed.

I can hear some of you now saying “but what if I’ve left important notes on the pasteboard for the next person who works on the artwork”? Well, either don’t use this script, or put your notes on after you’ve run this script.

Empty Frame Remover

This script removes any purely empty frames, that is no fill or stroke that have no special settings applied such as text wrap or text on a path. Once run, it scans the document and removes all of these empty frames.

Trista DPI

The next script resamples all images over a given resolution to a more appropriate resolution. It’s great for projects such as yearbooks where the resolution of images is often far greater than it needs to be.

Now, I was in two minds to whether I show this script or not. Out of the scripts being shown in this video, this is both the most powerful and potentially most destructive of them. Ultimately, read the instructions before using this script, and make sure you have access to backups in case things go wrong.

Colour

Next, let’s address some colour issues that may have come about from selecting registration by mistake, or left-over swatches from a Microsoft Word import.

Unlike many scripts I’ve shown previously, most of these scripts are buried in forum posts, so it’s a matter of reading the post, finding the script, copying and pasting into a text editor and saving as a .jsx file.

It’s worth noting that all of these scripts only affect colours generated within InDesign, so won’t fix colour issues in links such as PDFs or photoshop files.

Add unnamed colours

Let’s start off with this easy one-line script that adds all unnamed colours to the swatches palette. True, it’s just as easy to select this from the swatches menu. Regardless how it’s run, this should be the first step to cleaning up the swatches. You can cut and paste it from below:

app.menuActions.item("$ID/Add All Unnamed Colors").invoke();

Reduce Colors

This script launches a prompt that allows you to search for colours that are a given percentage different from each other and merge them to the swatch that appears higher in the swatches panel.

If you’re using a special knockout black swatch and don’t want it to become the default black, perhaps make it a spot colour while running these scripts.

I explain the differences between these colours in more depth in Episode 14.

Registration Fix

This script converts all registration colour applied by InDesign to its respective tint of Black.

RGB/LAB GREY swatches to Shades of Black

I’ve written a script that converts RGB and LAB values that appear as shades of grey to equivalent shades of Black, while leaving other swatches alone to be dealt with by another script.

RGB/LAB swatches to CMYK

There’s another RGB/LAB converter, though this script converts all RGB/LAB swatches to CMYK values.

Faux Black fixers

There are two scripts that can take faux black values and convert them either to 100% black or rich black. The faux black is determined by CMYK values beyond certain percentages. In this case, any swatch that is over 70 Cyan, 60 Magenta, 60 Yellow and 90 Black will be converted to either 100% black or rich black. You can dig into the script if you like, and redefine what constitutes a rich black or faux black.

Remove unused swatches

This will remove any swatches not used in the artwork.

Styles, Master Pages and Layers

Let’s make sure that we only have the necessary styles, master pages and layers that are required for the artwork.

Remove unused masters

This script removes any master pages that have not been used in the artwork.

Remove unused layers

Next is this script that removes any layers that contain no artwork.

Remove unused styles and groups

This is a series of scripts that removes any styles not used in the artwork, as well as unnecessary style groups that may have been left, whether deep in folders or not. In the video it is combined into one “catch-all” script for convenience, but it is the work of many authors, so it’s not right for me to host it. Links to the originals can be found here, here, here, here and here.

Delete guides

Lastly, this script removes all guidelines in a document. I can see that there would be some use for guidelines to remain in a document, but felt it was worth demonstrating.

Preflight

To be sure that the artwork is completely free of issues, we want to make sure that there are no prepress issues. To make sure that the artist complied with the preflight that was associated with the document, there’s the preflight enforcer.

As shown on the Colecandoo Youtube channel before, I’ve prepared two scripts that will either warn or prevent a user from printing or exporting to PDF until all preflight issues are resolved.

So there you have it, over ten scripts that will help make housekeeping of InDesign files a lot easier. If there’s any that I’ve missed or you feel would be worthy of a future video, let me know via my contact page.

%d bloggers like this: