Applescript question: Deleting empty column from table
- This topic has 3 replies, 3 voices, and was last updated 7 years, 7 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Applescript question: Deleting empty column from table
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Applescript question: Deleting empty column from table
Tagged: column table cell applescript
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.)
HI Aarona,
I would suggest posting AppleScript related questions to the AppleScript dedicated site:
https://macscripter.net/viewforum.php?id=2
Hope you’ll find your answers there.
Thanks Masood! Yes, this forum doesn’t look terribly active. Cheers!
Aaron, this isn’t true, but we speak Javascript instead of Applescript! ;-)
Kai
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!