Skip to main content
Participating Frequently
October 3, 2022
Answered

Run script from a custom script

  • October 3, 2022
  • 3 replies
  • 808 views

Hello guys, here my problem:

I would like to create a button on a dockable script to call a script in a specific location. Pratically a shortcut to a script...

here the code i'm using without success:

 

 

system.callSystem('cd "C:\Program Files\Adobe\Adobe After Effects 2022\Support Files"')

system.callSystem('afterfx -r  "\\isifcp\Storage_Dmpp\netapp\grafica\calcio\Magazine 2022\SERIE A\MAGAZINE MANAGER 2022_2023.jsx"')

 

 

Thanks in advance

This topic has been closed for replies.
Correct answer Mathias Moehl

You can simply do

$.evalFile(MY_FILE_HERE)

 

see https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object.html?highlight=evalFile#evalfile

 

3 replies

Mathias Moehl
Community Expert
Community Expert
October 3, 2022

Maybe it is easier to read the script file and eval its content?

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
Legend
October 3, 2022

Shouldn't matter which method you use, as ultimately you only call a file association and let Windows handle the rest, give or take potential permission issues.

 

Mylenium

Participating Frequently
October 4, 2022

hey @Mylenium 

 

your workaround works weel to me and i was able to reach my scope. However my first intent was to run the script without involving any other support file. What about the @Mathias Moehl suggestion? What code should i use to reach the .jsx location and evaluate his content?

 

Tnx for ur support

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
October 4, 2022
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
Legend
October 3, 2022

This would probably be done better by simply calling a *.bat file or Power Shell Script. These convoluted paths and multiple nested quote marks tend to throw things of as you would need to isolate them both in the script and the command string.

 

Mylenium

Participating Frequently
October 3, 2022

Ok,

 

let's say i have the bat file ready in folder. Then how wuold u call the .bat file?

 

By Execute() o with a System call?

 

Thank you