This has actually been added as a command in the latest release of InDesign (curse you Adobe, for improving your software and rendering my scripts obsolete). It still serves as a useful example for how to filter a bunch of objects based on a selector.
Download Update-all-modified-images.rb.zip.
As it’s only little, I’ve decided to let this source code live on the front page.
#!/usr/bin/env ruby
# rb-appscript code by Ian Haigh : http://ianhaigh.com/
# Fri Dec 4 15:54:38 EST 2009
require 'rubygems'
require 'appscript'
include Appscript
ai = Appscript.app('Adobe InDesign CS4.app')
# Update all modified images
ai.active_document.links[its.status.eq(:link_out_of_date)].update
One Comment
Hi Ian,
What the hell are you talking about?
Cheers,
AP