-
open/already opened project file before running the rest of the script
Hi Everyone, once again I can use your help! thanks in advance!
So I have a script that is specific to a project file, I decided to have the script open the file before running the rest of the script. So far, I was able to have the script open the file following the file path, if file path could not be found, then it opens the OPEN dialog box.
Where I am having problem is telling the script “If the file is already open” dont open the project file again and just run the script” I understand in javascript there is no “goto” to just tell the script to move pass the “open the project file” if the file is already open.
I included the script below. thanks for the help!
var my_file = new File("PROJECT PATH");if (my_file.open == true){
alert(new_project.file.name + " IS ALREADY OPEN");
}
else{
if (my_file.exists){
new_project = app.open(my_file); //Open the project following th file path
}
else {
new_project2 = app.open(); //If cant find the file, open the OPEN dialog box
}if (my_file.exists){
alert(new_project.file.name + " IS NOW OPEN, ENJOY"); //Just an alert to let the user know file is now open
}
else {
}}
Application// 1. THE SCRIPT THAT WILL RUN ONCE THE PROJECT FILE IS OPEN GOES BELOW HERE
// 2. NEED THE SCRIPT TO CHECK IF FILE IS OPEN BEFORE IT RUNS THE SCRIPT BELOW
// 3. ALSO NEED THE SCRIPT TO CHECK, IF THE FILE IS ALREADY OPEN, THEN JUMP TO THE SCRIPT BELOW THIS LINE WITHOUT HAVING TO OPEN THE PROJECT FILE AGAIN, IF ITS NOT OPEN, THEN FIRST OPEN THE PROJECT FILE THEN RUN THE SCRIPT BELOW.
"
Sorry, there were no replies found.