Copy link to clipboard
Copied
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.
1 Correct answer
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
...Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
lol. figured it out. I needed all the "\" to be changed to "/"
Tht did it. Thank you.
Copy link to clipboard
Copied
Also note that the constant for the string \\server\Folder\Folder is "\\\\server\\Folder\\Folder", since \ symbols in string constants need to be escaped.
Copy link to clipboard
Copied
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

