Indesign applescript error

Hello,
I cannot solve this problem. I want to get a property called “based on” from each paragraph style, and I want the “name” of each paragraph style. Most of the script works until I try to concatenate the “name” property with the “based on” property.

Here is the script

tell application "Adobe InDesign CS3"
	set pstyles to name of every paragraph style of document 1
	set basedOnList to {}
	repeat with i from 4 to count of pstyles
		set basedonstyle to based on of paragraph style i of document 1
		--set basedonstyle to basedonstyle as text
		--get class of basedonstyle (uncommented this returns "Unicode Text")
		--return result
		--return basedonstyle
		set namestyle to name of paragraph style i of document 1 as Unicode text
		--return namestyle
		get class of namestyle --(This also returns "Unicode Text")
		set fullstyle to namestyle & ":" & basedonstyle --(on error, applescript highlights basedonstyle variable)
		--return fullstyle
		--copy fullstyle & return to end of basedOnList
	end repeat
	
end tell
--basedOnList

Here is the error: Applescript Error: Can’t make «class psty» id 19642 of document “CBS_MasterLayout_Phys.indd” of application “Adobe InDesign CS3” into type Unicode text.

Any suggestions?

I’m not in front of ID right now but it would appear you’re missing a parameter here.

should seemingly have a name parameter. Possibly name of based on. What class is “based on”? A property?

Good Luck.
Jim Neumann
BLUEFROG

it’s a property

I figured out that if a paragraph style is based on another style, getting the based on will return the paragraph style id.

Thanks.