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

Launch quicktime file in QT player, using extendscript in AE

Explorer ,
Mar 22, 2021 Mar 22, 2021

I think this can be done, but im struggling.
Goal:
In my AE UI, if a button is clicked, I want to launch a QT file that is located in a directory on a server. I dont want it imported, i just want it to open in QT.

Im thinking if it like a help tutorial for people using my UI.


TOPICS
Scripting
901
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 1 Correct answer

Enthusiast , Mar 22, 2021 Mar 22, 2021

from the Javascript Tools Guide.pdf

File system access > File object functions:

fileObj.execute ()

Opens this file using the appropriate application, as if it had been double-clicked in a file browser. You can use this method to run scripts, launch applications, and so on. Returns true immediately if the application launch was successful.

 

for example:

 

var theFile = File.openDialog("Choose the file to open");

alert(theFile.absoluteURI);

 

// and rather than an openDialog you'll probably be hardcoding i

...
Translate
Enthusiast ,
Mar 22, 2021 Mar 22, 2021

from the Javascript Tools Guide.pdf

File system access > File object functions:

fileObj.execute ()

Opens this file using the appropriate application, as if it had been double-clicked in a file browser. You can use this method to run scripts, launch applications, and so on. Returns true immediately if the application launch was successful.

 

for example:

 

var theFile = File.openDialog("Choose the file to open");

alert(theFile.absoluteURI);

 

// and rather than an openDialog you'll probably be hardcoding it in? although you'll probably have to tailor the path to the user's machine by deriving it from some file location your know

// theFile = File(<your file path here>);

 

if (theFile != null) theFile.execute();

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
Explorer ,
Mar 22, 2021 Mar 22, 2021

Hello, thank you. 

Still no luck. I am hardcoding it, so i removed the "if"
var theFile = File("\\server\Folder\Folder\MyVideo.m4v");
theFile.execute();

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
Enthusiast ,
Mar 22, 2021 Mar 22, 2021

Is that the file path you got when using my version and seeing what the alert said when you selected that file?

You could also try this which will give you an alternate kind of path:

alert(theFile.fsName);

 

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
Explorer ,
Mar 22, 2021 Mar 22, 2021

lol. figured it out. I needed all the "\" to be changed to "/"
Tht did it. 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
Community Expert ,
Mar 22, 2021 Mar 22, 2021
LATEST

Also note that the constant for the string \\server\Folder\Folder is "\\\\server\\Folder\\Folder", since \ symbols in string constants need to be escaped.

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 Expert ,
Mar 22, 2021 Mar 22, 2021

What @Paul Tuersley suggests it definitely the best and easiest option.

If you need more control and don't want to open the file with the operating systems default program for this type of file, launching a program using the system.callSystem() command is also an option, but more complicated: https://ae-scripting.docsforadobe.dev/general/system/#system-callsystem

 

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