using Javascript and ScriptUI to create a form that brings in a symbol in the library

Hi all

I tried to gather the right info to use javascript to create a shape to bring in particularsymbols of the symbol library based on the variables of the form. I took pieces of various examples of scripts and tried to make this work, but my problem is when I try to use conditional statements.

This is a limited version of what I want to do, but just to get the message.

1. I want to select a script that has various dropdowns. I want the first dropdown to give me 3 options: 10, 13, 18

2. I would also like another drop-down list that gives me three options: needle single, double needle and knife-blade.

3. I wish that it have an "ok" button and the button "Cancel".

4. from there when I click the ok button, a symbol is presented library according to what parameters have been given to the form.

ex. If I selected 10 the first descent to the bottom and double needle in the second, I would like to "SYMBOL" be pulled from the library and centered on the artboard.

ex. If I have selected 13 the first descent to the bottom and double needle in the second, I would like to 'SYMBOL B' to be pulled from the library and centered on the artboard.

I got the user interface is displayed and it works as expected, as well as to bring it into a symbol, my problem comes when I try to integrate functions and conditional statements.

Here is my script. Please let me know what I am doing wrong.

myDoc var = app.activeDocument;
var palette is new window ('dialog', 'Create a shell');.
Pallette.Add ('statictext', undefined, ' fill opening in inches: ");
Pallette.orientation = "row";
var myDropdown is Pallette.add ('dropdownlist', undefined, ['10', '13', '18']);.
myDropdown.selection = 1;
var myButtonGroup is Pallette.add ('group');.
myButtonGroup.orientation = "column";
var btnCreate = myButtonGroup.add ('button', undefined, 'OK');
MyFillSelection = myDropdown.selection
btnCreate.onClick = function () {}
If (MyFillSelection = '13') {}
symbolRef = A myDoc.symbols ["SYMBOL"];
symbolItemRef1 = myDoc.symbolItems.add (symbolRef);

Redraw();
}

}
btnCancel var = myButtonGroup.add ('button', undefined, 'Cancel');

Pallette.Show ();

If anyone has any input, it would be much appreciated.

Thank you

MyFillSelection = myDropdown.selection is outside the service, so it will always read '13', anything to change value.

Place this line in your service and add the text property... MyFillSelection = myDropdown.selection.text;

then do your if comparisons, that will do.

Tags: Illustrator

Similar Questions

  • I've created a form that uses the value field text to fill the text of another field.  Does not take into account changes

    I've created a form that uses the value field text to fill the text of another field.  However, if I need to change the text, the second field does not update this change.  Instead of reset the form each time, is the Javascript code to update the fields if they have been modified?

    For example I Text1 and Text2.

    When I type in Hello in Text1 I see Hello in Text2.

    Later, if I decide to change to Goodbye Text1, Text2 remains Hello.

    The shape of the hoe can recognize this change?

    Thank you

    Edit: I think I have misunderstood the situation.

    If you want to both fields have the same value, just to give them the same name.

  • I have created a form that is used to control an area of cleaning...

    I have created a form that is used to control an area of cleaning. I added a script to determine if a zone passes or failed (called Action1), which is 'Pass' or 'Fail', based on the mark in a field called Score1. If a zone fails, the user must correct the failure and return to corrected again the same area. Therefore, under this field is another area that the user must fill if the zone fails (called Score 1A), how can I add a script to automatically copy the Score 1 to Score1a mark if Action1 is a 'Pass' and leaving empty if it is a "failure"?

    They all have the same mean: you try to access a field name that does not exist.

    The "TypeError: f is null" error comes from a calculation script that uses one of the first two options in the calculation tab and others from a custom calculation script.

    You must remember that JS is case-sensitive and that the field names must be spelled EXACTLY as they appear in the file, including spaces, special characters, etc.

  • I have someone using PSCS4, and when she creates a pattern fill layer, it does not get a mask.

    I have someone using PSCS4, and when she creates a pattern fill layer, it does not get a mask.

    Any ideas on how it could have turned off and how we can re-enable default?

    I check its settings panel menu and "Add default mask" is checked.

    Thank you!

    She changed the Layer palette settings to not automatically create a mask with layers of filling.

    Is not an adjustment layer, so the adjustment layer setting does not apply (and two parameters should really be in the layers palette in order to reduce the confusion).

  • How to create a form that fills a page of review before being submitted?

    Anyone used Eloqua to create a form that fills a review page that the bidder has to address in order for the form to fill out?

    The sequence would be:

    1. landing page/form
    2. landing page with the data in the form of review
      • The second page with the form data will have to be approved before the presentation or the person could go back and change the data

    Thank you

    Jennifer Rash

    Hi Jennifer,.

    The way to do is to create a form with a field, mapping on a contact field you can set a value from us Let's say 1. and then on the second form, if the user access, he or she cannot present until whoever the approver is changes the value 0 (zero). Once the approval is made (assuming that anyone who needs to do this) the flag should be set to zero.

    Your form 2 form processing step can guide them in appropriate redirection, or javascript on the form page 2 can promot the user to wait for approval.

    Hope this helps... I would like to know if that's what you're looking for.

    Thank you

    Amit

  • By creating a form that has several text boxes to a single character on the same line, how can I get the cursor to go in the next text box automatically after inserting a character?

    By creating a form that has several text boxes to a single character on the same line, how can I get the cursor to go in the next text box automatically after inserting a character?

    Create a text field and use the option 'comb n characters.

  • Is it possible to create a form with text boxes of "adjustment" to the participants to answer the questions?

    Is it possible to create a form with text boxes of "adjustment" to the participants to answer the questions? Questions are open to everyone, so asking narrative responses.

    Hi landon39843319,

    You can have fields flowing / more dynamic in a PDF of LiveCycle Designer form, but not in an AcroForm (only created in Acrobat).  LiveCycle Designer is a program completely separated used for are delivered with each purchase Acrobat Acrobat XI has been release.  Now you must buy separately.  But LiveCycle Designer PDF forms are wrapped in a shell of PDF so that they will be displayed and can be filled in the free Acrobat Reader DC and earlier versions.

    If you do this in Acrobat with an AcroForm, you have as much information typed into a field that the user wants, but he's going to show everything on the screen.  Displays only the text that fits into the field, then a + sign will appear in the field to indicate that there is more text in this field, you can scroll down to read.  You can also set the automatic font size so that as more text is entered in the police becoming smaller and smaller to adjust the text, but that is usually not desirable for many forms.

    Hope this helps,

    Dimitri

    WindJack Solutions

    www.pdfscripting.com

  • I am currently using Windows Vista. I face a problem that I can't remove all the files in the form of MPEG-4. Error with code 0x800704C8.

    I am currently using Windows vista. I face a problem that I can't remove all the files in the form of MPEG-4. And the error with code 0x800704C8. What should I do so that I can delete these files? Please kindly help me to solve this problem. Thank you.

    original title: Code 0x800704C8...

    Hello

    Did you change your computer?

    Method 1:

    Step 1:

    I suggest you follow the link and check.

    What are the permissions?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-are-permissions

    Step 2;

    Why can't I delete a file or a folder?

    http://Windows.Microsoft.com/en-us/Windows-Vista/why-cant-I-delete-a-file-or-folder

    Diagnose and repair Windows files and folders problems automatically

    http://support.Microsoft.com/mats/windows_file_and_folder_diag/

    Method 2:

    I suggest to download and install the Microsoft safety scanner and run the scan and check.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    WARNING: There could be a loss of data while performing an analysis using the Microsoft safety scanner to eliminate viruses as appropriate

  • Is it possible to create a form requesting an email address before allowing the user to download something?

    My client would like to some testimonials on their site, but before the visitor can view that they would like to ask a few details such as an email address and list name.

    Is it possible to create a form that asks this information then opens to the top of the web page / download link to display the required information.

    Thank you very much.

    Yes. Commit email and address a required field and a link to the page of download "sent successfully."

  • I use a PC.  Problem: When you try to export my photo developed in the library, a message appears that says, "can't export, or offline or missing Source files."  How can I get my picture exported to my hard drive?

    I use a PC.  Problem: When you try to export my photo developed in the library, message box appears that says, 'impossible to export... '. Offline or missing source files. "How to fix this to export my photos on my hard drive?

    Lightroom is not in the expected location that he thinks that the photos are in the photos.

    This can happen because you have (perhaps accidentally) moved, renamed or deleted photos or folders containing them outside of Lightroom.

    The solution is to use your operating system to find the new location of the photos. Take note of where they are. Then in Lightroom, you can reconnect to them through these instructions: Adobe Lightroom - find folders and files moved or missing

    As an alternative, if the files were simply moved (and not renamed or deleted), you can use your operating system to move towards where Lightroom is expected to make them.

  • After that I have to redeem my code and try to download it says that it is impossible to open the page.

    After that I have to redeem my code and try to download it says that it is impossible to open the page.

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • Extract PDF form data using JavaScript and write in the CSV file

    I received a PDF file with a form.  The form is * not * formatted as a table.  My requirement is to extract form field values and write into a CSV file that can be imported into Excel.  I tried using the menu item "Merge data from spreadsheet files" automated in Acrobat Pro, but the release includes both the labels and values.  I'm mostly just interested in the form field values.

    I would use JavaScript to extract the data from the form and learn JavaScript write CSV file (since I know what should look like the spreadsheet of end).  I got regarding the extraction of the fields in the form:

    this.getField("Today_s_Date").value;

    And the rest of this post: http://StackOverflow.com/questions/17422514/how-to-write-a-text-file-in-Acrobat-JavaScript , I tried to write to CSV using:

    var cMyC = "abc";

    var doc = this.createDataObject ({cName: "test.txt", cValue: cMyC});

    but I get the following error:

    "SyntaxError: syntax error".

    1:Console:Exec ".

    Ideally, I don't want to use a third-party tool online to make, because the data are sensitive.  But please let me know if you have any suggestions.  The ideal output is a CSV file that an end business user can open in Excel to see the format of spreadsheet of his choice.

    Did anyone done this before?  Open to hearing alternatives as well.  Thanks in advance!

    The code you have posted works fine for me in the JavaScript console, so I suspect the problem is something else. Where did he put the code and y at - he seized another code?

    In addition, if CSV is not a strong requirement, I would say that you use delimited by tabs instead. Fields normally cannot contain tab characters, this is a good qualifier to use. It will be also more reliable when you import in Excel. If you need to process the field data that may contain quotes, you need prepare correctly the string data and can use a JavaScript library like this: https://github.com/uselesscode/ucsv

  • How to use a FOR LOOP to create multiple forms?

    I use Adobe animate CC (formerly Flash Professional CC) and I am trying to adjust the following snippet so that it creates several rectangles:

    var form = createjs new. Form (new createjs. Graphics ().beginFill("#FF0000").drawRect (5,5,100,100));

    this.addChild (shape);

    I then set it and put it in a loop I thought work in the reproduction of the form. The following code creates only a rectangle well?

    for (i = 0; i < 10; i ++) {}

    var i is new createjs. Form (new createjs. Graphics ().beginFill("#FF0000").drawRect (5,5,30,30));

    this.addChild (i);

    Move so that they do not lie on the other

    This.x += 50;

    }

    I think that the problem is how you use your iterator variable. In your loop, at the first start, i is equal to 0, then you immediately replace 0 with an instance of the Shape class, which means when he tries to loop again, I is not less than 10. They can't, because it is now a shape, not a whole number.

    Try this inside the loop:

    newshape var = new createjs. Form (new createjs. Graphics ().beginFill("#FF0000").drawRect (5,5,30,30));

    newshape.x += 50;

    this.addChild (newshape);

  • ADF set (true) disclose to showDetailItem using javascript and pass event

    Hi all

    We strive to integrate oracle ADF and Oracle Forms. We use integration javascript to call/interact with oracle forms

    Presentation of the ADF:

    Activate us or disable the appropriate showdetailitem based on a link.

    To enable forms indicating technicality (with id formssd1) and the javascript event passes to the forms, we use the code below

    function refreshReport(evt) {
      var formsLayout = AdfPage.PAGE.findComponentByAbsoluteLocator("pt1:r1:0:formssd1");
      if (formsLayout != null) {
       if (!formsLayout.getDisclosed()) {
       formsLayout.setDisclosed(true);
       }
      }
      var reportLink = evt.getSource();
      var reportID = reportLink.getProperty('reportID');
      alert(document.forms_applet);
      if (document.forms_applet != null) {
       document.forms_applet.raiseEvent('refresh', reportID);
      }
      else {
       window.setTimeout(invokeReport(reportID), 20000);
    
    
      }
    }
    
    

    Problem/question:

    The forms showDetailItem is it disclosed (true), it works fine. The javascript event through to the form and the form refreshes the report

    If the forms point showDetail is not disclosed, javascript allows the showdetail.  But the document.forms_applet attribute is not set.

    ADF: 12.1.3

    Forms: 11g R2

    Can you please let me know, how to reach the attribute (document.forms_applet)?

    I was able to solve the issue myself. I used a combination of clientListener and serverListener. I called the "document.forms_applet.raiseEvent" of managed bean and it solved my problem

  • Server behaviors &gt; insert a record said before using this server behavior, please create a form.

    Wow,

    I feel frustrated now and way over my head, below I have attached the registration page created with the form created next to the image.  Then, I went 'Bindings' and select 'Recordset' for this page and name the Recordset 'register '.  Please, everything works fine it has access to my database and the table and creates the Recordset file named 'register' now I'm going to "server behavior" as it says in the tutorial and select "Insert record" I get a prompt indicating before using this server behavior, create a form.  But my form is sitting there in the middle of the page!  My head is about to explode here!

    insert record set.JPG

    Thank you

    Carl

    Dallas4664 wrote:

    David powers,

    You said that "the opening form tag is not a name or an id to the form.

    So in my source code it should be something like:

    Then all my above entry codes

    You could try that, although when I tested it I have been authorized to access the behavior "Insert record" without any id or the name of the form.

    DW has created for me:

    Therefore, this

    became:

    As already said I would not advise using DW server behaviors.

Maybe you are looking for