Hello,
I’m stumped as to why this code works (when selecting a table cell):
tell application “Adobe InDesign CS6”
activate
tell active document
tell parent of selection
if items of contents of last column is “” then –have to break array down to items
delete last column
end if
end tell
end tell
end tell
…. but this code, where I’m trying to do the same for all tables document-wide, gets an error -1728:
–delete empty columns (that previously were merged)
tell application “Adobe InDesign CS6”
activate
tell active document
set allTables to every table of every story
repeat with i from 1 to count of allTables
set myTable to item i of allTables
tell myTable
if items of contents of last column is “” then
delete last column
end if
end tell
end repeat
end tell
end tell
(Actually the first one doesn’t work as I intend to — it only goes by the contents of the first cell of the column, because I don’t get how to ask if ALL cells are empty — but it at least doesn’t error like the 2nd.)