I’ve got my Chart format in Numbers down pat with help from this forum, but I’d like to add a Title to each chart.
The charts don’t show up using the UI Browser app, so I’m at a loss as to how to go about it.
The attached code creates a chart, and selects it, but how to address the ‘Title’ field?
Regards
Santa
tell application "Numbers"
activate
tell document 1
tell sheet 1
tell current application to delay 0.1
tell table 1
tell current application to delay 0.1
set thisRangeName to "A:B"
set selection range to range thisRangeName
tell current application to delay 0.5
end tell
tell application "System Events" to tell process "Numbers"
tell current application to delay 0.2
click menu item "Chart" of menu 1 of menu bar item "Insert" of menu bar 1
set x to 0
repeat until exists menu 1 of menu item "Chart" of menu 1 of menu bar item "Insert" of menu bar 1
tell current application to delay 0.1
set x to x + 1
if x ≥ 40 then exit repeat
end repeat
try
click menu item (my theNumbersGraphType) of menu 1 of menu item "Chart" of menu 1 of menu bar item "Insert" of menu bar 1
on error
try
click menu item "3D Stacked Column" of menu 1 of menu item "Chart" of menu 1 of menu bar item "Insert" of menu bar 1
on error
click menu item 1 of menu 1 of menu item "Chart" of menu 1 of menu bar item "Insert" of menu bar 1
end try
end try
tell current application to delay 0.1
set x to 0
end tell # sheet 1
repeat until exists chart 1
tell current application to delay 0.1
set x to x + 1
if x ≥ 40 then exit repeat
end repeat
set width of chart 1 to (width of chart 1) * 1.8
tell application "System Events" to tell process "Numbers"
try
if value of checkbox "Title" of scroll area 3 of window 1 is 0 then
click checkbox "Title" of scroll area 3 of window 1
end if
end try
try
if value of checkbox "Legend" of scroll area 3 of window 1 is 1 then
click checkbox "Legend" of scroll area 3 of window 1
end if
end try
end tell
end tell
end tell
end tell
Model: Late 2014 retina i7, Yosemite
AppleScript: 2.4
Browser: Safari 600.2.5
Operating System: Other