Copy link to clipboard
Copied
Hi all
Using indesign javascript how to check the application is available in the mac or not
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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")
}
Copy link to clipboard
Copied
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 )
Copy link to clipboard
Copied
Hi Uwe, I couldn’t get the versioning to work. I’m running InDesign 2020 and this returns false
var specificVersionString = "indesign-15.0.1.209";
Copy link to clipboard
Copied
It works if I get the version via the diagnostics property, which returns 15.064, but that’s not the version About InDesign displays...
Copy link to clipboard
Copied
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 )
Copy link to clipboard
Copied
Hi Rocky@
if you need to check the application version and application name
you can use application properties
appName=app.name;
appVersion=app.version;
Copy link to clipboard
Copied
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 )
Copy link to clipboard
Copied
Ah. Something I forgot: Check, what this will return:
apps
More revealing perhaps:
var result = apps;
result.sort().join("\r")
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
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);
}