Scrivener to InDesign

Proof of concept below (very geeky, I am afraid):
xaxa


[code](**
PROOF OF CONCEPT: Relink images embedded in Scrivener RTF’s and exported to InDesign to their originals
… based on the fact that Exif CreateDate is maintained througout the odyssee.

Usage

  1. Export as RTF from Scrivener
  2. Pipe through Word 2008 (open in Word, save as…) – this is necessary to make the Scrivener RTFs compatible with InDesign
  3. Import (Place) in InDesign
  4. Use “Unembed Link” in InDesign’s “Link” palette to export the embedded images to a folder of choice
  5. Run this script, choose one of the images in the dialog

**)

– choose file (change this as required)
set myfile to choose file
set myfilepath to POSIX path of myfile

– Extract Exif ‘CreateDate’ with exiftool (sorry, Spotlight/mdls does not do the trick; kMDItemFSCreationDate is empty)
set mydate to do shell script “exiftool -d ‘%d/%m/%Y %H:%M:%S’ -s -s -s -CreateDate '” & myfilepath & “'”
set mydate to date mydate

– find file by date and time (this does for some reason not work with images inside a managed Aperture library)
property MacEpoch : (date (“01/01/2001” as string)) + (time to GMT)
set mysec to (mydate) - MacEpoch
set myResultPaths to do shell script “mdfind ‘kMDItemContentCreationDate == " & mysec & "’”

display dialog myResultPaths[/code]

Scrivener 2.0 will no longer make the MS word detour necessary - see this thread: [url]RTF and images - #4 by xaxa]
(Note that the whole thing is a bug in InDesign’s handling of RTF and Keith is kind enough to work around it…)