Interogating a tab record in Quark

Background:
I have written a script to extract all the properties for every Style Sheet in a quark file and save it as a text file that I can then analyse. The final hurdle to over come is getting all the tab info for any given paragraph style.

Below is an extract from my script code dealing with the properies of a single tab record but I get errors stating
Error: “QuarkXPress™ 4.11 got an error: Can’t make some data into the expected type”.

Question:
Can some one point out what is wrong or have I hit another limitation of Quark and Applescript?

Explanation of Code:
The first 9 lines of the code are unimportant it is lines 10 thru 15 where I am stuck. I am assigning the state of each of the four properties of a tab record to a variable of its own which I will then pass onto a subroutine to write them to a text file. This will eventually be enclosed in a repeat loop to cycle thru every tab record in a paragraph style.

Code:
tell application “QuarkXPress™ 4.11”
tell document 1

	set theTestBox to make new text box at beginning with properties ¬
		{name:"Script Test Text Box", bounds:{0, 0, 100, 100}, runaround:none runaround, color:null, suppress printing:true, vertical justification:centered}
	set story 1 of theTestBox to "Script test text"
	
	set theStyles to name of every style spec as list
	set s to length of theStyles
	set style sheet of story 1 of theTestBox to (item s of theStyles as string)
	tell style spec s
		tell paragraph attributes
			
			tell tab record 1 of paragraph 1 of theTestBox
				set tabAlignChar to align character
				set tabJust to justification
				set tabFillChar to fill character
				set tabPos to position
			end tell
			
		end tell
	end tell
end tell

end tell
end

Hi :slight_smile:

Here one suggestion (for QXP 3):

tell application "QuarkXPress™ 3.32"
	tell document 1
		set Lst to name of every text box
		if ("Script Test Text Box" is not in Lst) then
			set theTestBox to make new text box at beginning with properties ¬
				{name:("Script Test Text Box") ¬
					, bounds:{0, 0, 100, 100} ¬
					, runaround:none runaround ¬
					, color:null ¬
					, suppress printing:true ¬
					, vertical justification:centered}
			set story 1 of theTestBox to "Script test text"
		else
			set theTestBox to a reference to text box "Script Test Text Box"
		end if
		set theStyles to name of every style spec as list
		set s to length of theStyles
		set style sheet of story 1 of theTestBox to (item s of theStyles as string)
		tell style spec s
			set {LstTab, LstTabOk} to {tab list of text and paragraph attributes, {}}
			set {tabAlignChar, tabJust, tabFillChar, tabPos} to {"", "", "", ""}
			repeat with ItmTab in LstTab
				try
					set tabAlignChar to align character of ItmTab
				end try
				set tabJust to justification of ItmTab
				set tabFillChar to fill character of ItmTab
				set tabPos to position of ItmTab
				set end of LstTabOk to {tabAlignChar, tabJust, tabFillChar, tabPos}
			end repeat
			return LstTabOk
		end tell
	end tell
end tell

:wink: