ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

AE Script: Need to infer Script directory cross-platform

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ryan_W
AE Script: Need to infer Script directory cross-platform
on May 27, 2010 at 1:11:14 am

This seems like something many folks would need to do, but I have been running around going nuts the last couple days trying to find how to do this.

I am trying to write a script that can be dropped into the AE ScriptsUI folder along with an AEP. When the user runs the panel, it will import and utilize the AEP. The importing-a-project part is easy... but the thing is, I don't really want to explicitly have a file path to where the scriptsUI folder is on MY computer. That doesn't apply to everyone. I want this script to work for people that have different versions of AE (CS3 and up), different versions of Windows, different versions of Mac OS...

I would have thought somewhere I could call up a property where AE simply knows the directory where it's running from, and then I could modify the path from there... but I can't seem to find anything like that. Does anyone know what I could do? Or, perhaps a smarter way of doing this?

Thanks

Ryan


Return to posts index

Dave LaRonde
Re: AE Script: Need to infer Script directory cross-platform
on May 27, 2010 at 2:32:11 pm

[Ryan_W] "Does anyone know what I could do?"

Different operating systems? Different AE versions? Automatically find a file path? Tell you what you do:

Go to London. Find Diagon Alley. Go to Ollivander's Wand Shop and get yourself fitted out. They don't take credit cards, so you'll need to bring gold Galleouns, silver Sickles and Bronze Knuts.

What you propose falls into the realm of magic.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

Ryan Wieber
Re: AE Script: Need to infer Script directory cross-platform
on May 27, 2010 at 6:45:52 pm

...really? This is asking the impossible? I mean, come on, at the very least, my backup plan is to do an OS check, and based on that, simply guess the usual file paths it tends to be installed to, until it hits one that exists. I'd think that would work for many cases... but not all.

Doesn't it seem like, when After Effects is running, that it would know *where* it's running?


Return to posts index


Dave LaRonde
Re: AE Script: Need to infer Script directory cross-platform
on May 28, 2010 at 3:32:58 pm

I should also add that what you propose to do is just about the weirdest way to run AE I've ever heard.

You wrote, "...a script that can be dropped into the AE ScriptsUI folder along with an AEP. When the user runs the panel, it will import and utilize the AEP."

You should never, EVER mix project files with system files. They should always be elsewhere, preferably on another drive... right along with your footage for the project, nicely organized into folders.

It's as if you're saying, "I want to move my car's gas tank into the passenger compartment. Can anyone tell me how to do it?"

Sure, it can be done, but I doubt anyone has a procedure written down to do it, nor wants to volunteer an answer.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

Ryan Wieber
Re: AE Script: Need to infer Script directory cross-platform
on May 28, 2010 at 6:23:01 pm

I think you misunderstand my intention. I'll attempt to elaborate.

The goal is not to run the AEP in order to run the script. That would, indeed, be backwards. I'm conceiving of a script that loads lots of pre-created elements for the user, into their own project. Rather than do a boatload of scripting to generate these elements, it would seem much easier to have an AEP full of these elements (like comps and such) that the script simply opens and imports. So the AEP is simply a resource file that the script needs. The script is kind of an import tool, invoked within whatever project the user is working on.

Which is why I'm trying to think of a logical and reliable place for the resource AEP to exist for the script to call upon it. It seemed logical to me that it reside along with the script itself, making "installation" simple, and to my human brain, seems like a place where it could be "found" fairly easily... if I could deduce where either the ScriptsUI folder is, or where AE is running.

Does that make more sense?



Return to posts index

Dave LaRonde
Re: AE Script: Need to infer Script directory cross-platform
on May 28, 2010 at 8:47:04 pm

Okay, to summarize:
  • From any AE project you happen to have open at the time, you want to run a script that will import a second, "Utility" project
  • This project will contain frequently-used elements
  • This project may be updated from time to time
  • This project will also be located in the same folder with your scripts
  • It is EXTREMELY bad and dangerous practice to store ANY kind of project file in with system files

With these things in mind, I can only say this: It's much easier to simply store this project file in an easily-accessible location in with your other documents. Moreover, to do what you propose -- as I understand it -- is a disaster waiting to happen. And you're actually looking for a way to do it!

Sorry, but to draw upon an earlier analogy, I don't have the plans for moving a gas tank into your car's passenger compartment.



Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]