Skip to main content
Known Participant
January 15, 2015
Answered

Scripts that interact with other applications, such as Excel

  • January 15, 2015
  • 1 reply
  • 2066 views

Hello Everyone,

This is from the Illustrator CS6 Scripting guide.

"A script is a series of commands that tells Illustrator to perform one or more tasks. These tasks can be

simple, affecting only one object in the current document, or complex, affecting objects in all your

Illustrator documents. The tasks might even involve other applications, like word processors, spreadsheets,

and database management programs."

I have been trying to find a starting point to figure out how to do this, but I have not found any examples online. Is their any resources out there that anyone knows of? One of the things I am trying to do for example, is to copy a specific column from an excel document and pasting it into illustrator. Thanks in advance!

This topic has been closed for replies.
Correct answer CarlosCanto

agree with the comments above, there are different ways to solve a particular need...if you want to explore direct back and forth communication between Excel and Illustrator on Windows, here's a little start up guide

Re: Illustrator VBA scripting 101 - via Excel

1 reply

Silly-V
Legend
January 15, 2015

Mmm, well, what are you on, Mac or Windows?  I've actually been messing around with this and I've got stuff working on Macs better than I do PCs, because Applescript is somewhat more intuitive to me.  Most advanced I've gotten previously was re-creating a chart inside Illustrator from Excel by reading the chart properties with Applescript and then launching a dynamically created javascript to draw it in Illustrator.

Known Participant
January 16, 2015

Thanks for commenting, I have both a mac and pc, but the pc has office so I will be using that. So you were able to use an AppleScript script in Excel to call a JavaScript script in Illustrator and use the data from the excel script in the JavaScript/Illustrator one? That's awesome I've been trying to figure out if doing something like that was possible. I would like to use Javascript as much as possible because I don't know much about VBA, but if it's possible to use JavaScript for the Illustrator portion of the script, I am sure their are lots of VBA Excel examples I can look at because Excel is probably pretty commonly used by people with programming knowledge. I just need to learn how to go back and forth between applications and programming languages in script. 

Silly-V
Legend
January 16, 2015

Ok, I can tell you my experience, and if anyone sees this and can comment a better way, please do:

I think that you can do the copying of your Excel data in VBA, but the only way I know currently is to have a macro inside the excel workbook, which always lives in there and can copy your data , then execute a jsx file, and somehow pass the data in via clip-board or even a temporary .txt file.  The problem with that is that you have to have your workbook macro-enabled, or have a workbook in your excel application which has the macro which can run, but it's the convoluted principle that you have to have this thing in your Excel at all times you want to use it. (As opposed to just running a durn script and not having to open a file with a script inside of it in Excel). 

The other way I can think of is using AutoHotKey to do pretty much the exact same thing, except instead of messing with Excel-specific VBA stuff, you'd have to mess with AHK script, but not have to worry about macros and workbooks.

I think for copying and pasting column cells, you can probably get away with AHK, but this is such unknown territory for me, and like I said, it looks so much easier on Mac, because your applescript can control all the things from one place.

This is very limited world-view that I would like to learn more about, I call out all the lurkers to come out of ye shadows to shed some light on this.

Actually I believe the great CarlosCanto  has much expertise on using Excel and AI together!