Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Run script from a custom script

Community Beginner ,
Oct 03, 2022 Oct 03, 2022

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

TOPICS
Expressions , Scripting
562
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

LEGEND , Oct 03, 2022 Oct 03, 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

Translate
Community Expert , Oct 04, 2022 Oct 04, 2022
Translate
LEGEND ,
Oct 03, 2022 Oct 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 03, 2022 Oct 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 03, 2022 Oct 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 04, 2022 Oct 04, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2022 Oct 04, 2022

You can simply do

$.evalFile(MY_FILE_HERE)

 

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

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 04, 2022 Oct 04, 2022
LATEST

Thanks a lot @Mathias Moehl @Mylenium 

your help was really valuable to me and i've learned a lot of useful code and approaches.

 

see u soon

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2022 Oct 03, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines