Copy link to clipboard
Copied
Any Sublime text experts out there... ? Made a build system to send current file to be executed in AFX...
I did try it with the -s and feeding a line of code and it works. So when I switch to sending the current file....
It switches over to AFX but does nothing... can't figure it out. I am aware of the build system from AEtuts but I
am trying to figure stuff out and learn as I go along.... (Not an expert in Sublime/Python/cmd line)
//Contents of my build file...
{
"cmd": ["afterfx", "-r", "\"$file\""]
}
//Which sends (I think) to the command line.
Running afterfx -r "C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\ScriptUI Panels\AED_CornerCutters\AED_AdjustmentLayer.jsx"
After Effects is called but doesn't read the jsx....
Any ideas?
Copy link to clipboard
Copied
Hi,
I believe AE doesn't load your script because it's in a folder inside the ScriptUI panels.
just, try to change that path:
"C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\ScriptUI Panels\AED_CornerCutters\AED_AdjustmentLayer.jsx"
to that:
"C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\ScriptUI Panels\AED_AdjustmentLayer.jsx"
Copy link to clipboard
Copied
Thanks for the reply but same deal - not working - just popping over to After Effects and doing nothing.
Copy link to clipboard
Copied
Hi,
I'm the guy from that thing at AeTuts+
Instead separating it in 3 different arguments, you could just do
"cmd": ["afterfx -r $file"]
and this should be alright. Althought if you want to test what's your path you can do
"cmd": ["echo $file"]
I've also had some problems with Windows and to had encoding like:
"cmd": [...],
"encoding": "cp850"
don't ask me why but it fixed some bugs.
It's all untested code but I hope it can help you!
Copy link to clipboard
Copied
Hi Sebastian - Know you well on the web, only watched your mini - documentary there last week.
Many thanks - will try that when I return from holidays...
I already tried your build, but it's not exactly what I need. Anyway I am pretty happy to code and pop across to ESTK to send to AFX, it's no big deal really, just an extra click. This is just to get script to run in AFX - when not needing to bug check.
Really appreciate that.
A
Copy link to clipboard
Copied
Cool good to know!
Also, just to let you know, I also realized that testing in After Effects would sometimes not be enough so I rebuilt the Sublime Text build system to be a real plugin for ExtendScript. To only "build" files (copy paste it to After Effects/PS/Ai/etc. folder and compile #includes if wanted). You can get more details here https://github.com/seblavoie/sublime-extendscript or on the packages site https://sublime.wbond.net/packages/ExtendScript.
Cheers,
Seb
Copy link to clipboard
Copied
Merci beaucoup pour l'assistance!
Copy link to clipboard
Copied
Sans problème! ![]()
Copy link to clipboard
Copied
Is it possible to send the code directly from sublime without saving/copying procedure? Much like ExtendScript Toolkit does it.
Copy link to clipboard
Copied
Yes, by using this build system: https://github.com/seblavoie/After-Effects-Scripting-Sublime-Text-Package, you can get some more explanations here: http://ae.tutsplus.com/tutorials/workflow/improve-your-ae-script-development-workflow-with-sublime-t...
Copy link to clipboard
Copied
Sebastien,
I noticed on the AeTuts+ page that some comments referred to the fact that the debugger in ESTK cannot be used with your build system. Is this still the case? If not, how can we use the debugger with your build system?
Thanks!
Copy link to clipboard
Copied
Not yet, right now I use the previously mentionned Sumblime Text plugin and alt+tab to extendscript then ctrl+r when I need to run/test it. I tried creating an applescript to open the file from the estk but there seems to be some issues which may be related (somebody correct me if I'm wrong) to the fact that the estk relies on flash.
Copy link to clipboard
Copied
I wouldn't doubt it. The dockable script panels in AE are all Flash based. That's why they take forever to load if you have a lot of docked scripts. You'll see a flash of white (the Flash artboard), then the UI will load. My AE at work takes about a minute or so to launch due to all the scripts I have docked in my interface.
Copy link to clipboard
Copied
Sebastien Lavoie wrote:
I tried creating an applescript to open the file from the estk but there seems to be some issues which may be related (somebody correct me if I'm wrong) to the fact that the estk relies on flash.
I tried this too, just today. Here is the AppleScript I wrote just to see if I could bring an application to the front:
tell application "ExtendScript Toolkit"
activate
end tell
When I run this within the AppleScript Editor, nothing happens. However, if I change "ExtendScript Toolkit" to literally any other application the script does in fact work as expected. So when I replace "ExtendScript Toolkit" with "Safari", "Adobe After Effects CC", "Mail", or "Chrome" those applications are placed in the front. Has anybody been able to, at they very least, bring ESTK to the front with AppleScript?
Thanks!
Copy link to clipboard
Copied
Okay, after reading this resource, under `The Process Class`, I discovered that you can go through the System Events application to bring ESTK to the forefront.
tell application "System Events" to set frontmost of process "ExtendScript Toolkit" to true
Copy link to clipboard
Copied
Just following up with the solution I'm using for building in Sublime, but debuggin in ESTK.
Here is the full AppleScript I am using in Sublime's build system:
tell application "System Events"
tell process "ExtendScript Toolkit"
set frontmost to true
click menu item "Run" of menu "Debug" of menu bar 1
end tell
tell application "Adobe After Effects CC"
activate
end tell
end tell
Here is the script I am using in Sublime:
{
"shell_cmd": "osascript ~/path/to/above/applescript.scpt"
}
This assumes that ESTK is already running and has the script you want to debug open. It also assumes, that you've got the `Automatic Reload of Changed Files` switched on under the `General` section in the `Documents` tab of ESTK's preferences.
If anybody can rework the above apple script so that it launches ESTK with the current file open in Sublime, that would be awesome. Thanks!
Copy link to clipboard
Copied
"shell":true
is the only other thing I needed to add to the build file - so it loads cmd.exe and runs it through it. That was the reason it was doing nothing.
Working now! so I can hot key it to run in AFX and turn on the debugger - so the ESTK will pop up for errors.
Copy link to clipboard
Copied
Yes but since you inject the code directly to After Effects you probably won't be able to use things such $.write(). You will have to rely to alert() which isn't as detailed. If I am wrong and you *can* use $.write, I'd be really interested in what is in your shell/cmd file.
Copy link to clipboard
Copied
Hi Sebastian -
I am not using a .bat file or anything - just sending the script from Sublime to Afx via cmd.exe.
So it's just the bare build file... to run the script in AFX
Running afterfx -r C:\Program Files\Adobe\Adobe After Effects CS5.5\Support Files\Scripts\tester.jsx
All I need.
Sometimes I use utility functions to switch between ESTK stuff and AFX - the snippet below switches between alert type boxes
in AFX or silent ESTK logging depending on a estkLogging variable.
//----------------------------------------------------------------------------------------------
function logger(str,des){
//logs to an alertbox or does a writeln in the ESTK
des = des||""; //optional 2 parameters or one.
if (logging==true){//enable logging.
if(estkLogging==true){ $.writeln(str + " : "+des); $.writeln("-------------------------------");}
else{feedback(str + " : "+des) ;}
} //if
}//close logger funct.
//--------------------------------------------------------------------------------------------
Also - native AFX feedback in the info panel...
write("This text appears in Info panel ");
writeln("This text appears on f irst line");
writeln("This text appears on second line");
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more