Skip to main content
Known Participant
November 26, 2024
Question

Using AppleScript to remove link boxes with no content

  • November 26, 2024
  • 1 reply
  • 565 views

I wrote a code as follows, but I found that it was not executed well. The error message was always: "Adobe InDesign CC 2019" encountered an error: "graphic of item 1 of every page of document id 4" did not understand the "count" information.

 

Can anyone tell me where the problem is?

 

tell application "Adobe InDesign CC 2019"

set currentDoc to active document

repeat with currentPage in pages of currentDoc

repeat with currentGraphic in (every graphic of currentPage)

if (class of currentGraphic is image) then

set theLink to (link of currentGraphic)

if (theLink is missing value) or (status of theLink is link missing) then

delete currentGraphic

end if

end if

end repeat

end repeat

end tell

This topic has been closed for replies.

1 reply

leo.r
Community Expert
Community Expert
November 26, 2024

first, use all graphics instead of every graphic

leo.r
Community Expert
Community Expert
November 26, 2024

second, replace (link with (item link

Known Participant
November 26, 2024

Sorry, I am not very familiar with the instructions in InDesign, so I don't know how to modify what you said. Can you help me make changes in my code? Thank you very much for your help~