• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Possible bug with AppScript and Excel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible bug with AppScript and Excel?


  • Subject: Possible bug with AppScript and Excel?
  • From: Christian Prinoth <email@hidden>
  • Date: Fri, 30 Jul 2010 13:51:52 +0200

Thanks. In fact, I think that the problem I was experiencing is in fact due to AppScript (which is the python module allowing access to AppleScript dictionaries from Python), and I have solved it with the approach from my previous post.

BTW, I recommend Python+AppScript to every Applescript user, it opens a whole new world of possibilities ;)
In fact, I really hope that Apple one day makes Python an official OS X scripting language by allowing direct access to IPC tools from Python or by at least officially supporting AppScript.


On Fri, Jul 30, 2010 at 02:39, Timothy Murphy <email@hidden> wrote:
There is a difference in approach depending on whether you are creating, or addressing, a chart as an object in a worksheet, or as a chart sheet.
Charts embedded in a worksheet belong to the chart object class so, in general terms:
<some code...>
--::this creates the chart object itself
set oChartObj to make new chart object at end ¬
with properties{ whatever..}
--::address the chart element of the object
tell chart of oChartObj
set chart type to line chart
set newSeries to make new series at end ¬
with properties {series values:¬
(-insert reference-), xvalues:¬
(-insert reference-), name:¬
(-insert reference-)}
--::still addressing  the chart element of the object, we now address its category axis, or x axis
set categoryAxis to get axis axis type category axis ¬
which axis primary axis
tell categoryAxis
--set has title to true
set has title to false
set crosses at to maximum scale
end tell
--::still addressing  the chart element of the object, we now address its value axis, or y axis
set valueAxis to get axis axis type value axis ¬
which axis primary axis
tell valueAxis
set major unit is auto to true
set major tick mark to tick mark none --options are:¬
--tick mark cross / tick mark inside / tick mark none / tick mark outside
set minor tick mark to tick mark none
set tick label position to tick label position high --places value labels (ie. the scale) outside the chart
(*options are: tick label position high/tick label position low/tick label position next to axis/tick label position none*)
set maximum scale to 1
set minimum scale to 0
set has title to false
end tell
--::End Tell -- (telling chart of oChartObj)

If you are telling a chart sheet, there is a difference:
set myChart to (make new chart sheet at end of active workbook with properties {name:.....})


tell active chart
--::this line gets the data for a series
make its series with properties {series values:-insert ref-, xvalues:-insert ref-, name:-insert ref-}


set size with window to true
--set chart type to line chart
set chart type to xy scatter smooth 
set the_x_Axis to (get axis axis type category axis ¬
which axis primary axis)
tell the_x_Axis
set major unit is auto to false  --etc.etc.
end tell
end tell

I hope this answers your question regarding Excel. 
Regarding Python...nfc, sorry.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re:Possible bug with AppScript and Excel? (From: Timothy Murphy <email@hidden>)

  • Prev by Date: Re:Possible bug with AppScript and Excel?
  • Next by Date: Possible bug with AppScript and Excel?
  • Previous by thread: Re:Possible bug with AppScript and Excel?
  • Next by thread: Possible bug with AppScript and Excel?
  • Index(es):
    • Date
    • Thread