• 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
Re: scripting for Adobe Illustrator error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scripting for Adobe Illustrator error


  • Subject: Re: scripting for Adobe Illustrator error
  • From: Jake Rowlands <email@hidden>
  • Date: Mon, 17 Oct 2016 10:20:59 -0400

I hope this helps. I have been struggling to re-learn what little scripting I know. I did not create the script, but trying to maintain it. Below is the replies from the Log History.



tell application "Adobe Illustrator"

get contents of selection

--> "Client"

activate

get properties of selection

--> {character offset:1, length:6, contents:"Client", kerning:missing value, story:story 1 of document 1, selection:{text from character 1 to character 6 of story 1 of document 1}, container:story 1 of document 1, best type:reference, default type:reference, class:text, index:1, text font:text font "HelveticaNeueLTStd-HvCn", size:13.0, horizontal scale:100.0, vertical scale:100.0, auto leading:false, leading:17.0, tracking:0, baseline shift:0.0, rotation:0.0, kerning method:optical, capitalization:normal, baseline position:normal, OpenType position:default, ligature:true, discretionary ligature:false, contextual ligature:false, fractions:false, ordinals:false, swash:false, titling:false, connection forms:false, stylistic alternates:false, ornaments:false, figure style:default, proportional metrics:false, italics:false, baseline direction:standard, language:English, alternate glyphs:default, Tsume:0.0, alignment:roman baseline, warichu enabled:false, warichu lines:2, warichu gap:0, warichu scale:50.0, warichu characters before break:2, warichu characters after break:2, warichu justification:auto justify, TCY vertical:0, TCY horizontal:0, aki left:-1.0, aki right:-1.0, no break:false, fill color:{class:spot color info, tint:100.0, spot:spot 2 of document 1}, stroke color:{class:no color info}, overprint stroke:false, overprint fill:false, stroke weight:1.0, underline:false, strike through:false, justification:left, first line indent:0.0, left indent:0.0, right indent:0.0, space before:0.0, space after:0.0, hyphenation:false, minimum hyphenated word size:6, minimum before hyphen:2, minimum after hyphen:2, maximum consecutive hyphens:99, hyphenation zone:36.0, hyphenate capitalized words:true, hyphenation preference:0.5, desired word spacing:100.0, maximum word spacing:150.0, minimum word spacing:89.999997615814, desired letter spacing:0.0, maximum letter spacing:10.000000149012, minimum letter spacing:-5.000000074506, desired glyph scaling:100.0, maximum glyph scaling:100.0, minimum glyph scaling:100.0, single word justification:full justify, auto leading amount:120.000004768372, leading type:bottom to bottom, tab stops:{}, roman hanging:false, BunriKinshi:true, Burasagari type:none, Kinsoku order:push in, KurikaeshiMojiShori:false, Kinsoku:missing value, Mojikumi:missing value, every line composer:false}

end tell

tell application "System Events"

keystroke "a" using command down

end tell

tell application "Adobe Illustrator"

redraw

--> current application

get properties of selection

--> {character offset:1, length:303, contents:"Client: COVERGIRL

Job#: 16PGCWT001

Target Spring 17

File Name:

44524011_CWT001_EyeEnhancers_BN.ai

Date/Artists: 09.12.16 RB

Last Revision: 09.13.16 RB

Change Order#: 009

Die#: 110500_1ft_BN

Size: 11.674\" w x 1.900\" h

DIE INFO AND DIMS ARE FINAL

Application: Illustrator CC

ART IS: 100%  PROOF IS: 100%  ", kerning:missing value, story:story 1 of document 1, selection:{text from character 1 to character 303 of story 1 of document 1}, container:story 1 of document 1, best type:reference, default type:reference, class:text, index:1, text font:text font "HelveticaNeueLTStd-HvCn", size:13.0, horizontal scale:100.0, vertical scale:100.0, auto leading:false, leading:17.0, tracking:0, baseline shift:0.0, rotation:0.0, kerning method:optical, capitalization:normal, baseline position:normal, OpenType position:default, ligature:true, discretionary ligature:false, contextual ligature:false, fractions:false, ordinals:false, swash:false, titling:false, connection forms:false, stylistic alternates:false, ornaments:false, figure style:default, proportional metrics:false, italics:false, baseline direction:standard, language:English, alternate glyphs:default, Tsume:0.0, alignment:roman baseline, warichu enabled:false, warichu lines:2, warichu gap:0, warichu scale:50.0, warichu characters before break:2, warichu characters after break:2, warichu justification:auto justify, TCY vertical:0, TCY horizontal:0, aki left:-1.0, aki right:-1.0, no break:false, fill color:{class:spot color info, tint:100.0, spot:spot 2 of document 1}, stroke color:{class:no color info}, overprint stroke:false, overprint fill:false, stroke weight:1.0, underline:false, strike through:false, justification:left, first line indent:0.0, left indent:0.0, right indent:0.0, space before:0.0, space after:0.0, hyphenation:false, minimum hyphenated word size:6, minimum before hyphen:2, minimum after hyphen:2, maximum consecutive hyphens:99, hyphenation zone:36.0, hyphenate capitalized words:true, hyphenation preference:0.5, desired word spacing:100.0, maximum word spacing:150.0, minimum word spacing:89.999997615814, desired letter spacing:0.0, maximum letter spacing:10.000000149012, minimum letter spacing:-5.000000074506, desired glyph scaling:100.0, maximum glyph scaling:100.0, minimum glyph scaling:100.0, single word justification:full justify, auto leading amount:120.000004768372, leading type:bottom to bottom, tab stops:{}, roman hanging:false, BunriKinshi:true, Burasagari type:none, Kinsoku order:push in, KurikaeshiMojiShori:false, Kinsoku:missing value, Mojikumi:missing value, every line composer:false}

set selection to {}

redraw

--> current application

get every text frame of document 1 whose contents = "Client: COVERGIRL

Job#: 16PGCWT001

Target Spring 17

File Name:

44524011_CWT001_EyeEnhancers_BN.ai

Date/Artists: 09.12.16 RB

Last Revision: 09.13.16 RB

Change Order#: 009

Die#: 110500_1ft_BN

Size: 11.674\" w x 1.900\" h

DIE INFO AND DIMS ARE FINAL

Application: Illustrator CC

ART IS: 100%  PROOF IS: 100%  "

--> {text frame 1 of layer 4 of document 1}

end tell

tell application "System Events"

set frontmost of process "Adobe Illustrator" to true

set frontmost of process "Adobe Illustrator" to true

click menu item "Default" of menu "Tools" of menu item "Tools" of menu "Window" of menu bar item "Window" of menu bar 1 of process "Adobe Illustrator"

--> menu item "Default" of menu "Tools" of menu item "Tools" of menu "Window" of menu bar item "Window" of menu bar 1 of application process "Adobe Illustrator"

get size of every window of process "Adobe Illustrator"

--> {{2580, 1382}}

set frontmost of process "Adobe Illustrator" to true

click menu item "Default" of menu "Tools" of menu item "Tools" of menu "Window" of menu bar item "Window" of menu bar 1 of process "Adobe Illustrator"

--> menu item "Default" of menu "Tools" of menu item "Tools" of menu "Window" of menu bar item "Window" of menu bar 1 of application process "Adobe Illustrator"

get size of every window of process "Adobe Illustrator"

--> {{2580, 1382}}

Result:

error "Can’t get item 1 of {}." number -1728 from item 1 of {}


On Thu, Oct 13, 2016 at 3:05 PM, Jake Rowlands <email@hidden> wrote:
I have tried being specific to the exact application as you listed for InDesign without success. I will have to learn debugging of the script to aid in pinpointing the error of item 1. I did not write the script and am new to scripting.

Regards,
Jake Rowlands

On Thu, Oct 13, 2016 at 3:02 PM, RJay Hansen <email@hidden> wrote:
I can’t help you with the Illustrator specific problem as I haven’t done any scripting with it. However I have several scripts I’ve written for InDesign. I have four versions of InDesign on my machine (CS6 thru CC 2015) and I have no problems with my scripts knowing which version of InDesign to use.

I use:

tell application “Adobe InDesign CC 2015”
scripting stuff here
end tell

I wonder if addressing the Illustrator version directly like that might solve your problem with it being finicky if multiple versions are installed on a machine.

RJay


On Oct 12, 2016, at 3:55 PM, Jake Rowlands <email@hidden> wrote:

Here is a snippet of the script that appears to have the error:
--say "window"


tell application "System Events"
tell process "Adobe Illustrator"
--beep
set frontmost to true
my do_submenu("Adobe Illustrator", "Window", "Tools", "Default")
set Sizes1 to size of every window
my do_submenu("Adobe Illustrator", "Window", "Tools", "Default")
set Sizes2 to size of every window
--beep
if length of Sizes1 is greater than length of Sizes2 then
set TheSize to item 1 of my RemoveComonList(Sizes1, Sizes2)
else
set TheSize to item 1 of my RemoveComonList(Sizes2, Sizes1)
end if
--beep
set TOOLS to every window whose size is TheSize
if TOOLS is {} then
my do_submenu("Adobe Illustrator", "Window", "Tools", "Default")
set TOOLS to every window whose size is TheSize
end if
--beep
tell item 1 of TOOLS
set WindowPosition to position
set item 1 of WindowPosition to (item 1 of WindowPosition) + (item 1 of clicker)
set item 2 of WindowPosition to (item 2 of WindowPosition) + (item 2 of clicker)
get WindowPosition


end tell


It is erring on item 1.

On Wed, Oct 12, 2016 at 3:27 PM, Jake Rowlands <email@hidden> wrote:

I am using Adobe Illustrator v2014.0.0 with the script below to auto update proof slug information. The script was originally written using AI CC 2013. It does get finicky if more than one version of Illustrator is on the machine as well. Once I removed AI CC 2013, the script worked in the newer version.

I have a user that has Adobe Illustrator 2015.3 with the following error when running the script. "Can't get item 1 of {}. Script Editor got an error: Can't get item 1 of {}. (-1728)"

What is the best way to share the script without exceeding the email size limit?




Thank you,
Jake Rowlands


 _______________________________________________
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

  • Follow-Ups:
    • Re: scripting for Adobe Illustrator error
      • From: Jake Rowlands <email@hidden>
References: 
 >scripting for Adobe Illustrator error (From: Jake Rowlands <email@hidden>)
 >Re: scripting for Adobe Illustrator error (From: Jake Rowlands <email@hidden>)
 >Re: scripting for Adobe Illustrator error (From: RJay Hansen <email@hidden>)
 >Re: scripting for Adobe Illustrator error (From: Jake Rowlands <email@hidden>)

  • Prev by Date: Re: About path to temporary items.
  • Next by Date: Re: scripting for Adobe Illustrator error
  • Previous by thread: Re: scripting for Adobe Illustrator error
  • Next by thread: Re: scripting for Adobe Illustrator error
  • Index(es):
    • Date
    • Thread