Skip to main content
Known Participant
March 19, 2021
Question

Script to check the application is available or not

  • March 19, 2021
  • 6 replies
  • 815 views

Hi all

 Using indesign javascript how to check the application is available in the mac or not

 

 

This topic has been closed for replies.

6 replies

samy@123
Inspiring
March 23, 2021

Hi Rocky

To check wheather indesign is available or not   run this code//////////////////////////

 

 

if ($.os.toString().match("Windows", "i")){
Pc = "Windows";
if(app.name.indexOf("Adobe InDesign") !=-1){
alert("Adobe indesign Available in windows")
}
}else
if($.os.toString().match("Macintosh", "i")){
pc="Macintosh";
alert(pc);
}

Community Expert
March 22, 2021

Ah. Something I forgot: Check, what this will return:

apps

More revealing perhaps:

var result = apps;
result.sort().join("\r")

 

Regards,
Uwe Laubender

( ACP )

Community Expert
March 22, 2021

You could also exploit the string that is returned by that:

BridgeTalk.__diagnostics__;

 

For example if you need to know the file path to the installed application.

 

FWIW: This all is "only" working for apps that are able to work with ExtendScript's BridgeTalk class.

If you need the information about applications that are not Adobe or will not work with the BridgeTalk class you must go a different way. Perhaps best with AppleScript executed by ExtendScript. But AppleScript is out of my field of knowledge.

 

Regards,
Uwe Laubender

( ACP )

Community Expert
March 22, 2021

Thanks, Rob!

Hi Rocky, with Rob's code you could be even more specific.

If you need to know for example if any version of InDesign 2021 is available, you could test this like that:

var specificVersionString = "indesign-16.064";
var targetApp = BridgeTalk.getSpecifier( specificVersionString );

if( targetApp )
{
	$.writeln( specificVersionString + " is available")
} else
{
	$.writeln("No app by that name " + specificVersionString )
};

Regards,
Uwe Laubender

( ACP )

rob day
Community Expert
Community Expert
March 22, 2021

It works if I get the version via the diagnostics property, which returns 15.064, but that’s not the version About InDesign  displays...

Community Expert
March 22, 2021

Hi Rob,

the explanation for this: "15" is the main version, "064" means 64 bit application.

You cannot have two or more versions of the same main version of InDesign installed and running side by side. So this is sufficient to see, if InDesign 2020 is installed at all. For a more detailed look you have to start InDesign and use app.version on it.

 

Regards,
Uwe Laubender

( ACP )

rob day
Community Expert
Community Expert
March 21, 2021

You can check for an Adobe app you want to target with the Bridgetalk class getSpecifier method:

 

 

 

var targetApp = BridgeTalk.getSpecifier( "photoshop");

if( targetApp ) {
  $.writeln("Photoshop is available")
} else {
    $.writeln("No app by that name")
}

 

 

 

Abambo
Community Expert
Community Expert
March 19, 2021

Sorry, but I don't understand. What script are you looking for?

 

Or are you writing a JavaScript to see if InDesign is installed on the machine?

ABAMBO | Hard- and Software Engineer | Photographer