Applescript?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

Anyone ever messed around with hooking up applescript into AE scripts? Like, triggering scripts with droplets?
drockne
Posts: 13
Joined: March 2nd, 2012, 10:10 am

Yes, for something as basic as telling after effects to run a script from an applescript the scripting guide found here: http://wwwimages.adobe.com/www.adobe.co ... _guide.pdf has some useful examples on page 8.

Terminal commands can also be quite useful and turned into executables easily. That's how I launch my aerender nodes in one of my scripts.
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

Bumping this thread again. I'm trying to get Applescript to execute an external jsx script. I have tried it two ways and both seem to fail for different reasons.

1st approach fails because applescript does not like the path to the script file I'm giving it. This location should be pretty static so I can afford to keep it hard coded.

Code: Select all

	tell application "Adobe After Effects CS6"
				DoScript "	var a = " & file_path & ";
				app.project.importFile(new ImportOptions(File(a)));
				var scriptFile = new File("/Applications/Adobe\ After\ Effects\ CS6/Scripts/TestTrigger.jsx");
				scriptFile.open();
				eval(scriptFile.read());
				scriptFile.close();
				 "
	end tell
2nd approach fails in After effects with an error "Unable to Execute in line 1, expected ";". I haven't figured out how to supply the path yet other than choosing it which will not work in the long run.

Code: Select all

	set theFile to choose file
	tell application "Adobe After Effects CS6"
		DoScript theFile
	end tell
Can anyone give me any tips on how to get the paths working between AE and AS?
drockne
Posts: 13
Joined: March 2nd, 2012, 10:10 am

If your second method is failing inside after effects with an expected ";" error are you sure that the issue is with your applescript launcher and not the script you are trying to launch? That sounds like the kind of issue you'd run into if there was a syntax issue with the JSX script.

I tried to go the route of using applescripts for a tool I was working on and ran into lots of similar issues. I ended on landing on using command line commands in terminal instead. Basically all you need to do is issue the terminal command to launch after effects, but add a "-r scriptpath" after it. You can save those commands in a .command file and make them into executables, but that sounds like it'll add more steps to your process than you'd like.

As far as droplets go, I have messed around with doing them. I'd have to tear into my old code a bit and see how I got it working. I'll try and post again after I get some time to do that. Best of luck in the mean time.
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I'll give the command line approach a shot. I'm trying to hand off a snippet of code to an Applescript Developer who is assisting my client with some automation. I'm handling the Ae stuff and he is doing the AS part.
Post Reply