Highlighted

How do I add a drop-down list to a dialog box?

Explorer ,
Jun 15, 2020

Copy link to clipboard

Copied

I want to add a drop down list to this dialog box (script already available on this forum).

The drop down list content should contain say:

A

B

C

If user selects A, clicking on the Execute button displays message corresponding to A and same for others.

 

LaunchPalette();

function LaunchPalette()
{
	var resource =
		"""palette {
			
              properties:{ closeButton:true, maximizeButton:false,
				minimizeButton:false, resizeable:true },
			
              orientation:'row', spacing:15, margins:10,
              
              helloButton: Button { 
                  text:'Say Hello', alignment:['fill','fill'] },
             
              closeButton: Button { 
                  text:'Close', alignment:['fill','fill'] },
        }""";   
    
    var palette = new Window (resource, "My Palette");
    
    palette.layout.layout(true);
    palette.show();
    palette.bounds = {x:100, y:100, width:158, height:38};
    palette.layout.resize();

    palette.helloButton.onClick = function() 
    {
        alert("Hi there! You are using FrameMaker version "
            + app.VersionMajor + "." + app.VersionMinor + "." + app.VersionRevision
            + ".\n\nYour username/login is \"" + app.UserLogin + "\"."
            + "\n\nThe product is installed at the following location:\n\n  "
            + app.HomeDir
            + "\n\nHave a nice day!");
	};

    palette.closeButton.onClick = function() 
    {
        palette.close();
        palette = null;
	};

    palette.onClose = function() 
    {
        palette = null;
	};


    palette.onResize = function() 
    {
        palette.layout.resize();
	}
 }

Views

69

Likes

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

How do I add a drop-down list to a dialog box?

Explorer ,
Jun 15, 2020

Copy link to clipboard

Copied

I want to add a drop down list to this dialog box (script already available on this forum).

The drop down list content should contain say:

A

B

C

If user selects A, clicking on the Execute button displays message corresponding to A and same for others.

 

LaunchPalette();

function LaunchPalette()
{
	var resource =
		"""palette {
			
              properties:{ closeButton:true, maximizeButton:false,
				minimizeButton:false, resizeable:true },
			
              orientation:'row', spacing:15, margins:10,
              
              helloButton: Button { 
                  text:'Say Hello', alignment:['fill','fill'] },
             
              closeButton: Button { 
                  text:'Close', alignment:['fill','fill'] },
        }""";   
    
    var palette = new Window (resource, "My Palette");
    
    palette.layout.layout(true);
    palette.show();
    palette.bounds = {x:100, y:100, width:158, height:38};
    palette.layout.resize();

    palette.helloButton.onClick = function() 
    {
        alert("Hi there! You are using FrameMaker version "
            + app.VersionMajor + "." + app.VersionMinor + "." + app.VersionRevision
            + ".\n\nYour username/login is \"" + app.UserLogin + "\"."
            + "\n\nThe product is installed at the following location:\n\n  "
            + app.HomeDir
            + "\n\nHave a nice day!");
	};

    palette.closeButton.onClick = function() 
    {
        palette.close();
        palette = null;
	};

    palette.onClose = function() 
    {
        palette = null;
	};


    palette.onResize = function() 
    {
        palette.layout.resize();
	}
 }

Views

70

Likes

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
Jun 15, 2020 0
Explorer ,
Jun 30, 2020

Copy link to clipboard

Copied

anyone who can solve this query?

Likes

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
Reply
Loading...
Jun 30, 2020 0
Adobe Community Professional ,
Jun 30, 2020

Copy link to clipboard

Copied

Hi, when I have non-FrameMaker specific ScriptUI queries, I always post them on the InDesign forum and tag the post with Scripting. There is more traffic over there and there are some wireheads that are very helpful from the script side.

 

There is a fantastic free ScriptUI guide published by Peter Kahrel at

https://creativepro.com/files/kahrel/indesign/scriptui.html

 

Likes

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
Reply
Loading...
Jun 30, 2020 1
Explorer ,
Jul 07, 2020

Copy link to clipboard

Copied

Thank you frameexpert.

 

I wanted to do this in FrameMaker.

I used the code pasted in the previous comment in FrameMaker but cannot add list to it.

 

Will check the link you have shared.

Will the Indesign code work for FrameMaker also?

 

Likes

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
Reply
Loading...
Jul 07, 2020 0
Adobe Community Professional ,
Jul 07, 2020

Copy link to clipboard

Copied

Yes, the ScriptUI code in ExtendScript is common across all Adobe products that support ExtendScript.

Likes

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
Reply
Loading...
Jul 07, 2020 1
sam.m1 LATEST
Explorer ,
Jul 07, 2020

Copy link to clipboard

Copied

Thank you frameexpert, I will try that.

Likes

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
Reply
Loading...
Jul 07, 2020 0