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

Script to check the application is available or not

Contributor ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

Hi all

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

 

 

TOPICS
Scripting

Views

494

Translate

Translate

Report

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 19, 2021 Mar 19, 2021

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?

ABAMBO | Hard- and Software Engineer | Photographer

Votes

Translate

Translate

Report

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 21, 2021 Mar 21, 2021

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")
}

 

 

 

Votes

Translate

Translate

Report

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

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 )

Votes

Translate

Translate

Report

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

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";

Votes

Translate

Translate

Report

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

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...

Votes

Translate

Translate

Report

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

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 )

Votes

Translate

Translate

Report

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 ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

LATEST

Hi Rocky@ 

if you need to check the application version and application name 

you can use application properties

appName=app.name;

appVersion=app.version;

 

 

Votes

Translate

Translate

Report

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

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 )

Votes

Translate

Translate

Report

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

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 )

Votes

Translate

Translate

Report

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

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);
}

Votes

Translate

Translate

Report

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