Re: scripting Illustrator CS6
Re: scripting Illustrator CS6
- Subject: Re: scripting Illustrator CS6
- From: "Jacopille, David" <email@hidden>
- Date: Fri, 17 Oct 2014 21:24:40 +0000
- Thread-topic: scripting Illustrator CS6
Phil,
Here is a simple script to get you going. Hopefully you can take it from
here.
Dave
tell application "Adobe Illustrator"
set automatedBars to make new document with properties {color space:CMYK,
width:8.5 * 72, height:11 * 72}
tell automatedBars
set xDrawLocation to 25 -- left margin of box, which will be moved to
right for each box
set meterBarWidth to 15
repeat with theIncrement from 1 to 20
set meterBarHeight to 5 * theIncrement -- transform the increment into
actual bar height
make new path item at beginning with properties {entire
path:{{xDrawLocation, 200} ¬
, {xDrawLocation, 200 + meterBarHeight} ¬
, {xDrawLocation + meterBarWidth, 200 + meterBarHeight} ¬
, {xDrawLocation + meterBarWidth, 200}, ¬
{xDrawLocation, 200}} ¬
, stroke width:(1), filled:false, opacity:100.0, stroke cap:butted,
stroked:true}
set xDrawLocation to xDrawLocation + 25
end repeat
end tell
end tell
On 10/17/14, 1:29 PM, "2551" <email@hidden> wrote:
>Thanks, Dave
>
>I have the scripting guide. That was what caused me to ask for advice,
>cos it looks like a heavy learning curve, and I'm not exactly new to
>AppleScript... :)
>
>It ain't no 5-minute job to do it manually, which is why I want to script
>it. For each 5% increment and export, it's about about a minute to a
>minute and a half. Multiply that by 19 x 3 sets, it's at least an hour of
>manual repetitive work. Seems to me like ideal scripting work, if I can
>figure out the basic template of a script. :)
>
>
>
>
>
>> On 18 Oct 2014, at 00:23, Jacopille, David <email@hidden> wrote:
>>
>> Phil,
>>
>> I disagree that it is an ideal task for automation.
>>
>> Doing this manually seems like a 5 minute job in Illustrator. I¹m
>>pretty
>> fluent in scripting Illustrator and even I would do this manually.
>>
>> That being said, give it a try. Adobe has great documentation with good
>> examples. Google for Adobe Illustrator Applescripting Guide.
>> Illustrator¹s object model is well organized and enjoyable to work with.
>>
>> But you need more than 5 minutes.
>>
>> Dave
>>
>>
>> On 10/17/14, 1:04 PM, "2551" <email@hidden> wrote:
>>
>>> Are there any experienced Adobe Illustrator CS6 scripters on board?
>>>
>>> I need a head start on what is, on the face of it, the perfect task for
>>> automation. However, this is one app I've never scripted before and
>>>I'm a
>>> bit wary of investing more hours creating a working script than it
>>>would
>>> actually to take do the job manually.
>>>
>>> This is what I need to do:
>>>
>>> Basically, I have a set of custom made level meter icons for my app
>>>that
>>> consist of two objects in the artboard that I need to produce png's in
>>> x1, x2, and x3 scales. I need to adjust each object with a fixed height
>>> but variable length between the relative values of 5:95 all the way
>>> through to 95:5 in 5% increments.
>>>
>>> In other words, if Image 1 is height 5px, and width 100px, then both
>>> objects in the artboard start at height 5px and their relative widths
>>> start at
>>>
>>> Object A: 5px; Object B: 95px
>>>
>>> I need to produce 19 images for every width value between A:5px, B:95px
>>> and A:95px, B:5px in 5 pixel increments.
>>>
>>> I then need to produce all those images at x1, x2, and x3 (i.e., if x1
>>>is
>>> width: 100 pixels, height 5 pixels, I need to reproduce all 19 images
>>>at
>>> those values and also 19 images each at width: 200, height 10, and
>>>width
>>> 300 and height 15).
>>>
>>> If any one can help me with a heads-up on how to get started building
>>> such a script, it'd be much appreciated.
>>>
>>>
>>> Best
>>>
>>>
>>> Phil
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> AppleScript-Users mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>>fs
>>> .com
>>> Archives: http://lists.apple.com/archives/applescript-users
>>>
>>> This email sent to email@hidden
>>
>>
>> MFS Mail Relay Service made the following annotation on 10/17/14,
>>13:08:33
>>
>>
>>-------------------------------------------------------------------------
>>--------------------------------------------------------------
>>
>>
>> This email communication and any attachments may contain proprietary,
>>confidential, or privileged information. If you are not the intended
>>recipient, you are hereby notified that you have received this email in
>>error and that any review, disclosure, dissemination, distribution or
>>copying of it or its contents is prohibited. The sender does not waive
>>confidentiality or any privilege by mistransmission. If you have
>>received this email in error, please notify the sender immediately,
>>delete this email, and destroy all copies and any attachments.
>>
>>=========================================================================
>>=====
>>
>
>
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>AppleScript-Users mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>.com
>Archives: http://lists.apple.com/archives/applescript-users
>
>This email sent to email@hidden
MFS Mail Relay Service made the following annotation on 10/17/14, 17:09:10
---------------------------------------------------------------------------------------------------------------------------------------
This email communication and any attachments may contain proprietary, confidential, or privileged information. If you are not the intended recipient, you are hereby notified that you have received this email in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. The sender does not waive confidentiality or any privilege by mistransmission. If you have received this email in error, please notify the sender immediately, delete this email, and destroy all copies and any attachments.
==============================================================================
_______________________________________________
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