Author Topic: Illy, can't make data  (Read 4797 times)

0 Members and 1 Guest are viewing this topic.

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Illy, can't make data
« on: October 10, 2008, 08:19:09 AM »
Anyone see where this is going wrong:

Code: [Select]
tell application "Adobe Illustrator"
tell document 1

activate
--return properties of every path item
set ruler origin to {0, 0}
set zoom of view 1 to 0.89
set theStump to make new rectangle with properties
{position:{282.9570703125, 232.595703125}, name:"theStump", height:23.5, width:43.0, filled:true, fill color:{class:CMYK color info, cyan:25.0, magenta:42.0, yellow:100.0, black:37.0}, stroked:false, stroke color:{class:no color info}}
end tell
end tell

Getting error "Can't make some data into the expected type"

Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: Illy, can't make data
« Reply #1 on: October 10, 2008, 09:47:23 AM »
Hi there,

Simply remove ", stroke color:{class:no color info}" from your script and it will work.

Also, when confronted to such a situation, break up your properties to help you see which member is causing the problem:
Quote
001     tell application "Adobe Illustrator"
002          tell document 1
003               activate
004               --return properties of every path item
005               set ruler origin to {0, 0}
006               set zoom of view 1 to 0.89
007               set theProps to {}
008               set theProps to theProps & {position:{282.9570703125, 232.595703125}}
009               set theProps to theProps & {name:"theStump"}
010               set theProps to theProps & {height:23.5}
011               set theProps to theProps & {width:43.0}
012               set theProps to theProps & {filled:true}
013               set theProps to theProps & {fill color:{class:CMYK color info, cyan:25.0, magenta:42.0, yellow:100.0, black:37.0}}
014               set theProps to theProps & {stroked:false}
015               set theProps to theProps & {stroke color:{class:no color info}}
          
016               set theStump to make new rectangle with properties theProps
017          end tell
018     end tell
Then, it is just a matter of commenting out lines between lines 008 thru 015 to find out where this is going wrong.

Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: Illy, can't make data
« Reply #2 on: October 10, 2008, 09:57:21 AM »
Very nice advice. Thank you.

ps.
why is Illustrator hiccuping on stroke color?

Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: Illy, can't make data
« Reply #3 on: October 10, 2008, 10:26:08 AM »
It is not "hiccuping on stroke color", it is hiccuping on "no color info". As far as I can tell, an element always has a stroke and a fill color but there are other flags (filled and stroked) that are used to determine if they will show or not so setting a color to "no color info" simply does not seem possible.
Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5