Problem:
I want to get a list of missing files in an Illustrator file. The following code finds the links that are present but has a missing value in the “file path:file” part of the record returned. Note that the 1st one is missing its link and the second one is found.
Where or how do I get the name of the link that is missing?
Note: The finished code that answered this question is posted at the 3rd post. Any improvements would be greatly accepted.
tell application "Adobe Illustrator"
repeat with r from (number of placed items in current document) to 1 by -1
get properties of placed item r of document 1
end repeat
end tell
Dictionary:
placed item‚n [inh. page item] : Every placed artwork item
elements
contained by documents, group items, layers.
properties
properties (record) : all of this object’s properties returned in a single record
bounding box (list, r/o) : dimensions of placed art object, regardless of transformations
content variable (anything) : the content variable bound to this placed art object
file path (file specification) : the file containing the placed artwork
matrix (matrix) : The transformation matrix of the placed art object
Results of above script
tell application “Adobe Illustrator”
count every placed item of current document
5
get properties of placed item 5 of document 1
{file path:missing value, matrix:{class:matrix, mvalue_a:0.51823502779, mvalue_b:0.0, mvalue_c:0.0, mvalue_d:-0.51823502779, mvalue_tx:-4027.209228515625, mvalue_ty:4919.87744140625}, bounding box:{7795.0, 8498.0, 7919.875, 8333.75}, content variable:missing value, URL:“”, note:“”, layer:layer 1 of document 1, locked:false, hidden:false, selected:false, position:{12.4326171875, 601.0361328125}, width:64.71484375, height:85.1201171875, geometric bounds:{12.4326171875, 601.0361328125, 77.1474609375, 515.916015625}, visible bounds:{12.4326171875, 601.0361328125, 77.1474609375, 515.916015625}, control bounds:{12.4326171875, 601.0361328125, 77.1474609375, 515.916015625}, name:“”, blend mode:normal, opacity:100.0, isolated:false, knockout:disabled, editable:true, sliced:false, visibility variable:missing value, wrapped:false, wrap offset:missing value, wrap inside:missing value, container:layer 1 of document 1, best type:reference, default type:reference, class:placed item, index:5}
get properties of placed item 4 of document 1
{file path:file “CUSTOMER UPLOADS:InternationalBreak122007174312:IndriGautama.tif”, matrix:{class:matrix, mvalue_a:0.819576919079, mvalue_b:0.0, mvalue_c:0.0, mvalue_d:-0.819576919079, mvalue_tx:-6376.18896484375, mvalue_ty:7355.943359375}, bounding box:{7795.0, 8592.3203125, 7872.0400390625, 8498.0}, content variable:missing value, URL:“”, note:“”, layer:layer 1 of document 1, locked:false, hidden:false, selected:false, position:{12.4130859375, 391.1787109375}, width:63.14013671875, height:77.302764892578, geometric bounds:{12.4130859375, 391.1787109375, 75.55322265625, 313.875946044922}, visible bounds:{12.4130859375, 391.1787109375, 75.55322265625, 313.875946044922}, control bounds:{12.4130859375, 391.1787109375, 75.55322265625, 313.875946044922}, name:“”, blend mode:normal, opacity:100.0, isolated:false, knockout:disabled, editable:true, sliced:false, visibility variable:missing value, wrapped:false, wrap offset:missing value, wrap inside:missing value, container:layer 1 of document 1, best type:reference, default type:reference, class:placed item, index:4}
get properties of placed item 3 of document 1
…
The other 3 results deleted for brevity
…
end tell
File contents if AI file is opened in Text Edit:
Partial contents:
xapMM:Manifest
rdf:Seq
<rdf:li rdf:parseType=“Resource”>
stMfs:linkFormEmbedByReference</stMfs:linkForm>
<stMfs:reference rdf:parseType=“Resource”>
<stRef:filePath>/Users/stephanienorton/Desktop/IBM/AWA 08/LeeNEWcloseup2007.tif</stRef:filePath>
stRef:instanceIDuuid:1A58E052AD5911DC87BEF94D8226B11E</stRef:instanceID>
stRef:documentIDuuid:0C353C26A8E711DCB9F5E57E6773AD82</stRef:documentID>
</stMfs:reference>
</rdf:li>
<rdf:li rdf:parseType=“Resource”>
stMfs:linkFormEmbedByReference</stMfs:linkForm>
<stMfs:reference rdf:parseType=“Resource”>
stRef:[b]filePath/Users/stephanienorton/Desktop/IBM/AWA 08/Cindy1.tif[/b]</stRef:filePath>
stRef:instanceIDuuid:0478AA3BA72711DCA3D49B92A22D0417</stRef:instanceID>
stRef:documentIDuuid:0478AA37A72711DCA3D49B92A22D0417</stRef:documentID>
</stMfs:reference>
</rdf:li>
<rdf:li rdf:parseType=“Resource”>
stMfs:linkFormEmbedByReference</stMfs:linkForm>
<stMfs:reference rdf:parseType=“Resource”>
stRef:[b]filePath/Users/stephanienorton/Desktop/IBM/AWA 08/PND_119_green bg.tif[/b]</stRef:filePath>
stRef:instanceIDuuid:75cabfa1-920e-11d9-8b11-bbf652566e9e</stRef:instanceID>
stRef:documentIDadobe:docid:photoshop:75cabfa0-920e-11d9-8b11-bbf652566e9e</stRef:documentID>
</stMfs:reference>
</rdf:li>
<rdf:li rdf:parseType=“Resource”>
stMfs:linkFormEmbedByReference</stMfs:linkForm>
<stMfs:reference rdf:parseType=“Resource”>
stRef:[b]filePath/Volumes/CUSTOMER UPLOADS/InternationalBreak122007174312/IndriGautama.tif[/b]</stRef:filePath>
stRef:instanceIDuuid:5b4a0d01-920e-11d9-8b11-bbf652566e9e</stRef:instanceID>
stRef:documentIDadobe:docid:photoshop:5b4a0d00-920e-11d9-8b11-bbf652566e9e</stRef:documentID>
</stMfs:reference>
</rdf:li>
<rdf:li rdf:parseType=“Resource”>
stMfs:linkFormEmbedByReference</stMfs:linkForm>
<stMfs:reference rdf:parseType=“Resource”>
stRef:[b]filePath/Users/stephanienorton/Desktop/IBM/AWA 08/Barb.NewHeadcropped.tif[/b]</stRef:filePath>
stRef:instanceIDuuid:65f96f0e-920e-11d9-8b11-bbf652566e9e</stRef:instanceID>
stRef:documentIDadobe:docid:photoshop:65f96f0d-920e-11d9-8b11-bbf652566e9e</stRef:documentID>
</stMfs:reference>
I suppose I could read the AI file and pull out the stRef?
Anyone have any ideas?