🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
1 messages
1 total messages Started by Justin C Tue, 10 Jul 2012 10:57
altering fill of selected table cells based on content
#248
Author: Justin C
Date: Tue, 10 Jul 2012 10:57
46 lines
2515 bytes
InDesign CS2 & AppleScript


I'm selecting a group of cells in a table, and, if the text in
the cell is "N", I want the cell fill to be changed (there is
no fill currently, I want black with 40% tint).

Currently I have the following, cobbled together from various
resources on the web. I can't work out how to work through each
of the cells in the selection because my 'count of items in
selection' appears to be 1, I suppose that means there is one
contiguous selection only, but not the contents of that
selection.


tell application "Adobe InDesign CS2"
	-- Check we've got a document open
	if (count documents) is not equal to 0 then
		set mySelection to selection
		-- Do we have anything selected?
		if (count mySelection) is not equal to 0 then
			-- check the selection is table cells
			set myCellClasses to {column, row, table, line, cell}
			if class of item 1 of selection is in myCellClasses then
				-- 
			else
				display dialog "You have not selected any table cells"
			end if
		else
			display dialog "There is nothing selected"
		end if
	else
		display dialog "There is no InDesign document open"
	end if
end tell

I suppose I need help accessing the contents of the selection,
and then iterating over them.

Any help will be gratefully received.

   Justin.

-- 
Justin C, by the sea.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads