September 05, 2010, 08:21:54 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Illy, can't make data  (Read 960 times)
0 Members and 1 Guest are viewing this topic.
AutoFetishist
Sr. Member
****

Karma: 1
Offline Offline

Gender: Male
Posts: 302



« on: October 10, 2008, 05:19:09 AM »

Anyone see where this is going wrong:

Code:
1  tell application "Adobe Illustrator"
2   tell document 1
3  
4   activate
5   --return properties of every path item
6   set ruler origin to {0, 0}
7   set zoom of view 1 to 0.89
8   set theStump to make new rectangle with properties ¬
9   {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}}
10  end tell
11 end tell
12 

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


Logged
Publi-Script
Administrator
Hero Member
*****

Karma: 16
Offline Offline

Gender: Male
Posts: 544


Automate your Life!


WWW
« Reply #1 on: October 10, 2008, 06: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.



Logged

Michel Lemieux
Forum Administrator
-------------------------
OS X 10.5.8
Quark 6.5 / 7.5 / 8.01
Illustrator CS / CS2 / CS3 / CS4
Photoshop CS / CS2 / CS3 / CS4
InDesign CS / CS2 / CS3 / CS4
Dreamweaver 8 / 9 / CS4
Script Debugger 3
AutoFetishist
Sr. Member
****

Karma: 1
Offline Offline

Gender: Male
Posts: 302



« Reply #2 on: October 10, 2008, 06:57:21 AM »

Very nice advice. Thank you.

ps.
why is Illustrator hiccuping on stroke color?

Logged
Publi-Script
Administrator
Hero Member
*****

Karma: 16
Offline Offline

Gender: Male
Posts: 544


Automate your Life!


WWW
« Reply #3 on: October 10, 2008, 07: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.

Logged

Michel Lemieux
Forum Administrator
-------------------------
OS X 10.5.8
Quark 6.5 / 7.5 / 8.01
Illustrator CS / CS2 / CS3 / CS4
Photoshop CS / CS2 / CS3 / CS4
InDesign CS / CS2 / CS3 / CS4
Dreamweaver 8 / 9 / CS4
Script Debugger 3
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!