Adding Charts for Pages

I’m attempting to add a chart to pages, however when I attempt to compile sometimes I get a syntax error, and other times the script runs fine. I don’t get it…

Here’s the code:

	
				add chart column names {"Visual Basic", "Applescript"}¬
				row names {"2008", "2009"}  ¬
				data {{100,140},{80,200}} ¬
				type "line_2d"

Here this one behave flawlessly :


tell application "Pages" to tell document 1
	add chart column names {"Visual Basic", "Applescript", "VisualScript"} ¬
		data {{100, 140, 150}, {80, 200, 220}, {150, 100, 180}} ¬
		row names {"2008", "2009", "2010"} ¬
		type "line_3d"
end tell

Yvan KOENIG (VALLAURIS, France) mercredi 30 janvier 2013 20:36:00

Thanks Yvan,

Worked like a charm.