I had a script working at one time that interfaced Excel and Photoshop. I am trying to get some of the elements to work with AE. Below is the script lines I'm trying to use:
// Conect with Excel
var appexcel = "Excel.Application";
// Open a Excel XLS file - just type the path with double backslashes..
var wb = appexcel.Workbooks.Open("C:\\Interstitials 2004 NCTS.xls");
// Select the worksheet to work with - Asuming your data is in the first worksheet
var ws = wb.worksheets(1);
// Main loop - it reads the first 8 rows, and the first 3 columns as an example
for (row=3 ; row<36 ; row++) {
// Get the values
var firstname = ws.Cells(row, 1);
var lastname = ws.Cells(row, 2);
var number = ws.Cells(row, 3);
//After that, I would use the data to create or modify text layers.
_________________________________
The part that is giving me trouble is the wb.worksheets(1) line. AE gives me an error saying "Function wb.Worksheets is undefined" Does anyone have any idea what that means? Like I said, I had that info working with PS and also with Softimage XSI. It almost seems that AE does not use the same COM object or something.
Thanks all...
Connecting to Excel
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
posting for keiko yamada:
AE does not support VB script (Photoshop CS does). So the very first line does not create an object.
Workaround for this (I've not tested this, but I think it works):
1) Export excel worksheet as tab separated text file.
2) open txt file and readln() -- use tab (\t) as a separator while storing data from text file.
-keiko
Also, you should send in a feature request for this to: aftereffects@adobe.com
Paul T
AE does not support VB script (Photoshop CS does). So the very first line does not create an object.
Workaround for this (I've not tested this, but I think it works):
1) Export excel worksheet as tab separated text file.
2) open txt file and readln() -- use tab (\t) as a separator while storing data from text file.
-keiko
Also, you should send in a feature request for this to: aftereffects@adobe.com
Paul T
Are you sure that Javascript cannot access Excel? I pulled most of that code out of some other Javascript examples I was using for PS and XSI. I also used this link for guidance.
http://msdn.microsoft.com/library/defau ... object.asp
Maybe Jscript can access Excel where Javascript cannot? I will put in a feature request for this, we get a lot of data in Excel files. Thanks for getting back to me.
http://msdn.microsoft.com/library/defau ... object.asp
Maybe Jscript can access Excel where Javascript cannot? I will put in a feature request for this, we get a lot of data in Excel files. Thanks for getting back to me.
-
- Posts: 62
- Joined: September 5th, 2006, 3:45 am
- Location: Chiswick, London, UK
- Contact:
Please jump in to correct me if I'm wrong...
I think the problem here is that the JavaScript engine used by After Effects is a 'sand-boxed' Adobe engine and, though similar, it's certainly not the same as the one used by IE in Windows. Because of this it lacks the same ActiveX connections and many other capabilities that allow cross-talk with other Windows objects.
I've come to this conclusion having tried many methods demonstrated online, for reading Excel data into JavaScript. All seem to rest on the non-existant GetObject() method and ActiveXObject() object.
It feels cold and lonely, but its seems like our AE scripting environment is a desert island, with only a TCP connection's hope to cling to...
(Yes, the standard advice to import CSV abounds, but that doesn't mean we have to like it...).
I think the problem here is that the JavaScript engine used by After Effects is a 'sand-boxed' Adobe engine and, though similar, it's certainly not the same as the one used by IE in Windows. Because of this it lacks the same ActiveX connections and many other capabilities that allow cross-talk with other Windows objects.
I've come to this conclusion having tried many methods demonstrated online, for reading Excel data into JavaScript. All seem to rest on the non-existant GetObject() method and ActiveXObject() object.
It feels cold and lonely, but its seems like our AE scripting environment is a desert island, with only a TCP connection's hope to cling to...
(Yes, the standard advice to import CSV abounds, but that doesn't mean we have to like it...).
-
- Posts: 62
- Joined: September 5th, 2006, 3:45 am
- Location: Chiswick, London, UK
- Contact:
Atomic: Does your VB version rely on the GetObject() or ActiveXObject() functions. If so, these simply do not exist in AE's scripting environment. Refer to my previous post.
I just sent a feature request to Adobe over this, surely what they've done for Photoshop they could do for After Effects. It would open up a lot of possibilities for us.
I just sent a feature request to Adobe over this, surely what they've done for Photoshop they could do for After Effects. It would open up a lot of possibilities for us.
Last edited by Darkmoon_UK on November 7th, 2007, 9:07 am, edited 1 time in total.
I guess your right, I can not connect either. Jscript is Microsoft based and After Effects Javascript seems to be proprietary.
I did find this arcticle:
http://www.creative-workflow-hacks.com/ ... r-effects/
So how does this TCP connection work?
Is that built in to After Effects Javascript?
I did find this arcticle:
http://www.creative-workflow-hacks.com/ ... r-effects/
So how does this TCP connection work?
Is that built in to After Effects Javascript?
-
- Posts: 98
- Joined: March 14th, 2006, 2:16 pm
- Location: Atlanta, GA
- Contact:
The Socket Object is pretty handy for doing TCP stuff. You can also filter TCP requests through callSystem();So how does this TCP connection work?
-
- Posts: 62
- Joined: September 5th, 2006, 3:45 am
- Location: Chiswick, London, UK
- Contact:
Well, I ran with the TCP idea and came up with a Client/Server application to improve this situation, the 'Excel to ExtendScript Bridge'.
Check it out here: http://www.aenhancers.com/viewtopic.php ... 3416#p3416
Check it out here: http://www.aenhancers.com/viewtopic.php ... 3416#p3416