AppleScript input box issue

I created an AppleScript on my Mac Pro and the text input box never shows up! I've tried other samples and it never shows up, I tested the same script on my MBP and it works fine. This looks like a stretched circle with a down arrow. Here is a screenshot of the box...
Any ideas why this is happening?
Thanks

Hello
AppleScript applet shell under 10.10 is reportedly broken in such a way that you cannot input CJK text in answer field of "display dialog" command when the script is run as applet.
Temporary workaround would be to tell application other than applet itself to display dialog such as:
tell application "System Events"
    activate
    display dialog "Enter text" default answer ""
end tell
And let Apple fix this situation:
https://www.apple.com/feedback/macosx.html
Good luck,
H

Similar Messages

  • Simple Applescript Dialog Box Issue

    Hi,
    I am writing a very simple applescript that sets a variable to some text entered by the user in a textbox, in a dialog. Unfortunately, the font that is used to display what the user types is virtually unreadable, and therefore not at all fit for the purpose.
    I have recently had some problems with my system font cage, that required an entire re-install of the operating system, when I downloaded the new Microsoft Office 2011, but that issue has been resolved, and I can not see how it would effect applescript.
    Is there any way that I can change the font that is displayed as the user enters text. A photo of the dialog at the moment can be seen here:
    [img]http://www.freeimagehosting.net/uploads/b5102a5dd2.png[/img]
    Thanks for any help you can give me,
    Ari

    looks like a system font has been replaced by another....
    you could try to check/repair your fonts using apple's font book.app... already tried it?
    open it up, select all fonts (cmd+a) and select check fonts from the menu...

  • Text input boxes

    How can I make text input boxes in a JApplet so I can specify there location. I want to make input boxes in certain locations on the applet.

    Do you know about layout managers? If not:
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
    If you for some reason don't trust a layout manager to do the job for you, you can specify where you want to put things yourself by doing something like this:
    JApplet applet = ...
    applet.getContentPane().setLayout(null);  // Do not use a Layout Manager (generally a Bad Idea)
    JTextField input = new JTextField();
    input.setBounds(50, 75, 25, 100);  // Sets the position and size of your textfield
    applet.getContentPane().add(input);This is generally not recommended though, because different screen resolutions, cross-platform issues, any other things, might screw things up for you.
    ps.
    A little advice: try to be a little more patient the next time. You shouldn't start flaming the forum just because no one happens to answer your question within an hour . The people here are under no obligation whatsoever to help you -- they do it of their own free will in their own spare time.

  • Reduce the size of Input box comingby  default with search query

    Hi,
    I have created one EO and VO and one jsp for that . Inside that VO , there is one option Named Criteria, which is having All Queriable Attributes option , on drag and drop of this option i have got default search page for all the attributes which i had in my form , But with every dropdown am getting one input box to specify the value of my search, i want to reduce the size of that input box . there is no code in the jsp for those attributes.
    Please help
    Regards
    shadab

    Filed bug# 6501297 to track this issue. Thanks for reporting it.
    For now you'll need to manually add an additional facet to the content of the query component's "valueStamp" facet with the id of the same name as the attribute and manually set the properties on an <af:inputText> to the desired width.
    Between Tech Preview 2 and production the Query form component is being simplified to be more metadata driven, so this temporary workaround is applicable only to the TP2 release.

  • Error while trying to validate two input boxes at client side.

    This is the code i am using to validate two input boxes.
    I get an error in the IE which says: <b>'undefined is null or not an object'</b>
           function validateInput(){
                var noNull = validateNull();
                var noNullTwo = validateNullTwo();
                if(noNull==true)
                else
                     alert("Enter values");
                     htmlbevent.cancelSubmit="true";
         function validateNull(){
              var startRange;
              funcName = htmlb_formid + "_getHtmlbElementId";
              func = window[funcName];
              var temp1 = eval(func("range_Start"));
              startRange = temp1.getValue();
              if(startRange == '')
                   return false;
              else
                  if(startRange.length < 8)
                     alert("Enter the value in proper format");
                     htmlbevent.cancelSubmit="true";
                  else
                      return true;
         function validateNullTwo(){
              var endRange;
              funcName2 = htmlb_formid + "_getHtmlbElementId";
              func2 = window[funcName2];
              var temp2 = eval(func("range_End"));
              endRange = temp2.getValue();
              if(startRange == '')
                   return false;
              else
                  if(endRange.length < 8)
                     alert("Enter the value in proper format");
                     htmlbevent.cancelSubmit="true";
                  else
                      return true;
         </script>
       <hbj:form id="myFormId" >
         <hbj:textView id="title" text="Enter Sales Order Search Range" design="HEADER2"/><br><br>
         <hbj:label id="lb_SearchStart" text="Start Range:" labelFor="range_Start" />
         <hbj:inputField id="range_Start" jsObjectNeeded="true" type="string" required="true" maxlength="25"/>
         <hbj:label id="lb_SearchEnd" text="End Range:" labelFor="range_End" />
         <hbj:inputField id="range_End" type="string" maxlength="25"/><br><br>
         <hbj:button id="submit" text="Search!" tooltip="Click me to Search" onClientClick="validateInput()" onClick="searchPressed" design="emphasized" />
       </hbj:form>
      </hbj:page>

    Hi Portal Newbie,
       Please follow the below code. One i/p filed ,a button and a Java Script function.
        In the function i searched with only null, if you want you can perform another function.
       If you have any issues, please write me back.
      <hbj:inputField
            id="SystemId"
         disabled="false"
         type="string"
         maxlength="60"
         value=""
         jsObjectNeeded="true" />
      <hbj:button
            id="Search"
           text="Update"
           width="125px"
            tooltip=""
            onClick="UpdateSystem"
            onClientClick="validateFields()"
            disabled="false"
            design="EMPHASIZED"/>
    <script language= "JavaScript" >
         function validateFields(){
           var funcName=htmlb_formid+"_getHtmlbElementId";
           func=window[funcName];
           var inputfield=eval(func("SystemId"));
           var value=inputfield.getValue();
           if(value=="")
             alert("Please enter a value");
    </script>
    Thanks,
    Sridhar

  • Credits & lock box issues in SAP XI

    Hi All,
    what is the credits & lock box issues in SAP XI....? can any body explain me in detail and how to solve all these credits and lockbox issues...
    Thanks
    Sudheer

    Sudheer,
    I dont think you have any issues with these files. These files are sent to the Bank. Just google for help on these files. If you are expecting in detail explanation then I think you should give us few inputs.
    Regards,
    ---Satish

  • Simulation input box auto advance?

    I'm building a simulation and have a couple of questions:
    1) I have an input box where the user needs to enter text. If that text entered is correctly, the timeline will continue without the user having to press Enter.
    How is this possible?
    2) I have slides where the instructions call for the user to press enter to advance to the next slide. In Flash you can set up an event listener to listen to see if the Enter key is pressed.
    How would you do this in Captivate? The only way I've found is to add a text input box with a shortcut for Enter.
    Thanks in advance,
    Dan

    I think the issue here is that Captivate is an event-based application.  So there has to be some event triggered to which actions can then respond.
    You want there to be an event that is triggered as soon as the user enters the correct username in the field, without there being any other user interaction whatsoever.  If that's the way your software application is really set up to work at log on, it would be very unusual.  I'm not saying your app DOESN'T really work that way, because I know of some web apps using AJAX etc that are doing calls all the time to the server to check the current username or password, but it would be highly unusal break most of the user interaction models that people have grown up with in typical computer usage.
    Normally, after the user enters data into the username or password field, there is ALWAYS at least another button or key that they press to trigger the evaluation of username and password combination.  Captivate's interactive objects such as text boxes and buttons always assume this is the way things are going to work. They expect another user interaction of some kind. A keypress or a click.
    So trying to replicate the exact behaviour you describe requires that Captivate triggers an event based solely on the correct combination of letters in the text box field.  At the moment that sounds like some kind of special version of the text box widget to me.  I don't see any way to do it with standard Captivate functionality,
    Hope someone can prove me wrong.

  • Two clicks required to get results from Search Input box on toolbar.

    I'm running version 8.02.208.
    I'm new at Webhelp and was hoping somebody might be able to give me some pointers.
    If I open my published webhelp on the Internet and try to search using the Search Input box on the toolbar the first time, two clicks are required in order to get search results.
    This problem only appears the first time, all other searches from the Search Input box on the toolbar work properly with only one click required.
    In addition, the Search tool opened from the Search button always works fine first and every time, but I did see the extra space that I've read about.
    This is what I don't understand...the problem I mentioned with the 2 clicks required on the toolbar, never happens when I Generate and View the results. Meaning that I am looking at the output but have not published it yet. It works fine first and every time.
    Why would the problem show up one way and not the other? Does anyone know what could be different?
    I just keep hoping that there is something that I can do to get rid of the problem. I keep getting Problem Reports opened and assigned to me and complaints from customer service from customers. They think the search isn't working and I keep having to explain.....arghhhh!
    Thanks!
    Deb

    Hi Sheryl and Peter,
    I have also tried the options as you have suggested without success. Everything works fine when the WebHelp is published to a local or network drive but when it is published to the server the issue occurs.
    I would point out too, that I find that the problem with the space only occurs on the intial attempt to search using the Search Box. Any subsequent attempts without closing the browser appear to work fine.
    Chris

  • Client Input Box Locked

    Good afternoon everyone,
    One of my user has got the following issue:
    When trying to log on to our DEV system the client inuput box show client 100 by default.
    We are unable to change the client number, it always default back to 100 whenever we entered another value and move ot the user name input box.
    He is using SAP GUI 6.40.
    Any suggestions on "unlocking" this client number?
    Thank you
    Corinne

    Hi Corinne,
    this behavior isn't GUI related, it's a system parameter (login/system_client).
    Read <a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/41c43ac23cef2fe10000000a114084/frameset.htm">here</a> for more information (your parameter is at the end of the list) and ask your basis people if they are willing to change it (should depend, what the majority of your users use).
    Peter
    Points always appreciated

  • Conditional for a text input box NOT being null? Sorry for asking so many questions!

    Okay, here's the situation. I'm creating a simulation of a form on which there are several text input boxes, 7 of which are mandatory fields. I know I can use a conditional to check whether the box has nothing in it by creating a null variable with no value and doing "if [box variable] is equal to [null variable] then", but the problem is that the validation captions I need to show need to be shown in order, that is to say that the caption for entering a value for the first box will always be shown if that box is null regardless of the contents of other boxes, the second will be shown if that one is null and the first one isn't etc.
    When I was investigating this I noticed a post by Lilybiri saying that comparison with a null variable doesn't work for "not equal to" so I'm having a hard time figuring out how to show the captions based on priority. For example, to show the second caption I need to not only check whether the second box variable is null, but also whether the first one isn't.
    It gets pretty crazy further along the line where I get to the 7th mandatory field and need to check whether the first, second, third, fourth, fifth and sixth boxes are NOT null and whether the 7th one IS. Help!
    I did come up with one potential solution to this prior to posting: if I set a different advanced action for each input box losing focus which checks whether the variable is null and if so sets a "flag" variable to 0, and in the else set it to 1, I imagine I can then replace the "not equal to" with a check to that flag variable being equal to 1 (which means there is text in the box). I think this will work but I thought I'd check to see if there's an easier way first.

    No it DOESN'T require everything to be on one slide.  It just has to LOOK as if that's what it is.
    I would suggest that it doesn't really matter how many Captivate slides are involved in the final solution, as long as it works the same way (or as close as possible) to the original software that you are simulating.  Your users don't frankly know or care how you achieved the simulation.  I guarantee they won't be thinking of you or Captivate.
    In my experience, you can make creating elearning a lot more difficult than it needs to be in Captivate by trying to rebuild the app, rather than just simulating how it works. For example, thinking that if everything happened on one web page or screen in the app then it must also happen on a single slide in Captivate.  The fact of the matter is IT DOESN'T need to work this way.  And in some cases it might even be impossible to reproduce in Captivate this way.
    So the quickest path to a solution is often to use multiple slides, which has the advantage of allowing you to "fix" certain things on screen (e.g. the contents of fields already visited) by using READ ONLY variable output in transparent captions, focusing only on one element of the interface that the user can interact with on that slide.  It doesn't necessarily prevent you from moving back and forth between elements, just as you can in the original app.  But it is far easier to create and maintain.
    I'm not saying you wouldn't be able to pull this off on one slide in Captivate, but it is going to require a LOT of variables and Advanced Actions to build and debug.  So the term Rapid Elearning becomes something of a misnomer if it takes you a long time to complete one slide.

  • Text input box for displaying notes

    How can I use a text input box so delegates can write notes in which then appear on other pages as they work through the course.
    Ken

    It seems you would be able to do this with user variables, in which you store the content retrieved from the Text Entry Box. Later on (other slides) you can use this content by adding it to a Text Caption. Beware: I'm not sure about the amount of characters that can be stored.

  • Text input box to show in another text field

    Hello,
    I have a text input box (Text1) showing during a certain label on the stage.  On another label there is another text field (Text2) that is not input-able.  This second text field (Text2) should show whatever the user has inputted in the first text input field (Text1).
    Both of these elements are not symbols and right now they are both text elements.
    Does anyone know how to do this?
    Thanks,
    ~iana~

    I believe the inputField is set accordingly.  And including your reply, here's what I've got on my stage:
    sym.$("Name").attr('contentEditable', true);
    var inputValue = sym.$("Name").value;
    // other text
    sym.$("Signature").html(inputValue);
    Thus far, this does not work. "Name" field is Text1 (inputField) and the "Signature" is Text2 (text box)
    I'm new to all this so I've prob got something wrong...do you know what I should adjust?

  • Text input boxes same colour as background - so "invisible", and button text or buttons often missingt

    I have turned off all addons/extensions/plugins - still the same problem:
    1: Text input boxes appear to be the same colour as the background - and hence "invisible"
    2: Clickable buttons on websites are often invisible, or if they display have no text; e.g. button to right of google search ("go" button?) is seen as a plain box with no text - although button is clickable.
    3: Google webpage usually has an image - this is missing, and merely has "UK" to the top left of the input box.
    4: On this page for example I can see directly above this text box two vertical black lines - it appears to be a button with a pop-up "insert a link" - it can obviously be clicked when I mouse over it.

    See:
    * http://kb.mozillazine.org/Website_colors_are_wrong
    * http://kb.mozillazine.org/Websites_look_wrong

  • Allow the user to control the width of the edit forum post input box

    I would like to control the width of of the edit-forum post input box.  This could be:
    automatically adjust the width of the box so that the box doesn't run off the right edge of the window.
    have a user global preference to set the preferred width
    at least, allow the user to change the width via the change size icon.  The three horizontal bars at the lower left of the input box. You can adjust the vertical dimension, but not the horizontal. TenFourFox 4.0.1. This is probably being blocked for some obscure reason.
    Here is an example of an over extended right margin:
    Curiously enough, the "software" let's me adjust the width & height of the add reason to edit text, but not adjust the width of the more important edit text box.
    Robert

    Testing
    Standard Reply box can be height adjusted but not width.
    Same with Advanced Editor
    No Adjustment at all in HTL Editor
    Edit.
    The Edit uses the Advanced Editor
    Only Height Adjustment again.
    I do seem to remember someone posting about the width and saying they could drag it over the edge of the right hand edge (Into the grey surround)
    This may have been a post in the lounge.
    It didn't actually try it at the time but have played with it since and have not seen it.
    Maybe it is something they "Fixed" in both senses of the word.
    Second edit.
    I can't alter the box that currently reads "Message Edited by:- ..."
    I also can't get this box to accept New lines  (they appear in the box but don't post that way)
    Corrected Spelling
    9:51 PM      Wednesday; May 11, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously
    Message was edited by: Ralph Johns (UK)
    Message was edited by: Ralph Johns (UK)
    and new line with a line space as well

  • How do I create an input box with a cancel button that will end a loop in my script?

    I have been working on a script for my client and I am having trouble getting it to work properly. I stole most of the code from the PowerShell Tip of the Week "Creating a Custom Input Box". I also took someone's code for the Show-MessageBox function.
    I have slightly modified the original code with two parameters and an additional text box. The first field is for an e-mail address and the second is for an employee number.
    I need to know how I can get a Do Until loop to recognize when the cancel button is pushed and break the loop and effectively end the script. The work happens at the end but perhaps I need something added/modified in the InputBox function.
    I want the script to check to see if anything has been entered in the second text box. If empty it displays a message and calls the InputBox function again. Then if there is something I use elseif to check to see if it matches my RegEx (digits only). If
    it doesn't match it will loop and call the InputBox function again.
    This all works fine. The problem I am having is that I cannot cancel out of the form. I'd like the loop to continue until the second box matches my RegEx or Cancel is clicked. Clicking cancel doesn't break the loop. I need to know how I can stop the loop
    when cancel is pressed. I've seen Stack "Overflow: PowerShell Cancel Button Stop Script" but I don't think this will work in a loop.
    Any help would be awesome. As a note, I DO NOT want to use the VB Interaction stuff.
    function InputBox {
    param ($Name,$EN)
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $objForm = New-Object System.Windows.Forms.Form
    $objForm.Text = "Data Entry Form"
    $objForm.Size = New-Object System.Drawing.Size(300,200)
    $objForm.StartPosition = "CenterScreen"
    $objForm.KeyPreview = $True
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")
    {$x=$objTextBox.Text;$objForm.Close()}})
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")
    {$objForm.Close()}})
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,120)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
    $OKButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($OKButton)
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,120)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20)
    $objLabel.Size = New-Object System.Drawing.Size(280,20)
    $objLabel.Text = "Employee Email Address:"
    $objForm.Controls.Add($objLabel)
    $objTextBox = New-Object System.Windows.Forms.TextBox
    $objTextBox.Location = New-Object System.Drawing.Size(10,40)
    $objTextBox.Size = New-Object System.Drawing.Size(260,20)
    if ($Name) {
    $objTextBox.Text = $Name
    else {
    $objTextBox.Text = "@domain.com"
    $objLabel2 = New-Object System.Windows.Forms.Label
    $objLabel2.Location = New-Object System.Drawing.Size(10,70)
    $objLabel2.Size = New-Object System.Drawing.Size(280,20)
    $objLabel2.Text = "Employee Number:"
    $objForm.Controls.Add($objLabel2)
    $objTextBox2 = New-Object System.Windows.Forms.TextBox
    $objTextBox2.Location = New-Object System.Drawing.Size(10,90)
    $objTextBox2.Size = New-Object System.Drawing.Size(260,20)
    $objForm.Controls.Add($objTextBox)
    $objForm.Controls.Add($objTextBox2)
    $objForm.Topmost = $True
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
    $Script:ButtonName = $objTextBox.Text
    $script:ButtonEN =$objTextBox2.Text
    $ButtonName; $ButtonEN
    Function Show-MessageBox{
    Param(
    [Parameter(Mandatory=$True)][Alias('M')][String]$Msg,
    [Parameter(Mandatory=$False)][Alias('T')][String]$Title = "",
    [Parameter(Mandatory=$False)][Alias('OC')][Switch]$OkCancel,
    [Parameter(Mandatory=$False)][Alias('OCI')][Switch]$AbortRetryIgnore,
    [Parameter(Mandatory=$False)][Alias('YNC')][Switch]$YesNoCancel,
    [Parameter(Mandatory=$False)][Alias('YN')][Switch]$YesNo,
    [Parameter(Mandatory=$False)][Alias('RC')][Switch]$RetryCancel,
    [Parameter(Mandatory=$False)][Alias('C')][Switch]$Critical,
    [Parameter(Mandatory=$False)][Alias('Q')][Switch]$Question,
    [Parameter(Mandatory=$False)][Alias('W')][Switch]$Warning,
    [Parameter(Mandatory=$False)][Alias('I')][Switch]$Informational)
    #Set Message Box Style
    IF($OkCancel){$Type = 1}
    Elseif($AbortRetryIgnore){$Type = 2}
    Elseif($YesNoCancel){$Type = 3}
    Elseif($YesNo){$Type = 4}
    Elseif($RetryCancel){$Type = 5}
    Else{$Type = 0}
    #Set Message box Icon
    If($Critical){$Icon = 16}
    ElseIf($Question){$Icon = 32}
    Elseif($Warning){$Icon = 48}
    Elseif($Informational){$Icon = 64}
    Else{$Icon = 0}
    #Loads the WinForm Assembly, Out-Null hides the message while loading.
    [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
    #Display the message with input
    $Answer = [System.Windows.Forms.MessageBox]::Show($MSG , $TITLE, $Type, $Icon)
    #Return Answer
    Return $Answer
    $num = "^\d+$"
    do {
    if (!($ButtonEN)) {
    Show-MessageBox -Msg "You must enter a numeric value for the employee number." -Title "Employee Number Missing" -Critical
    InputBox -Name $ButtonName
    elseif ($ButtonEN -notmatch $num) {
    Show-MessageBox -Msg "The employee number must contain numbers only!" -Title "Non-numerical characters found" -Critical
    InputBox -Name $ButtonName
    until ( ($ButtonEN -match $num) -or (<this is where I want to be able to use the cancel button>)

    Here is a simple validation method.
    function New-InputBox{
    param(
    $EmailAddress='',
    $EmployeeNumber=''
    Add-Type -AssemblyName System.Windows.Forms
    $Form=New-Object System.Windows.Forms.Form
    $Form.Text='Data Entry Form'
    $Form.Size='300,200'
    $Form.StartPosition='CenterScreen'
    $OKButton=New-Object System.Windows.Forms.Button
    $OKButton.Location='75,120'
    $OKButton.Size='75,23'
    $OKButton.Text='OK'
    $OKButton.DialogResult='Ok'
    $OKButton.CausesValidation=$true
    $Form.Controls.Add($OKButton)
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,120)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text ='Cancel'
    $CancelButton.DialogResult='Cancel'
    $CancelButton.CausesValidation=$false
    $Form.Controls.Add($CancelButton)
    $Label1=New-Object System.Windows.Forms.Label
    $Label1.Location='10,20'
    $Label1.Size='280,20'
    $Label1.Text='Employee Email Address:'
    $Form.Controls.Add($Label1)
    $TextBox1=New-Object System.Windows.Forms.TextBox
    $TextBox1.Location='10,40'
    $TextBox1.Size='260,20'
    $textbox1.Name='EmailAddress'
    $textbox1.Text=$EmailAddress
    $Form.Controls.Add($textbox1)
    $Label2=New-Object System.Windows.Forms.Label
    $Label2.Location='10,70'
    $Label2.Size='280,20'
    $Label2.Text='Employee Number:'
    $Form.Controls.Add($Label2)
    $TextBox2=New-Object System.Windows.Forms.TextBox
    $TextBox2.Location='10,90'
    $TextBox2.Size='260,20'
    $TextBox2.Name='EmployeeNumber'
    $TextBox2.Text=$EmployeeNumber
    $Form.Controls.Add($TextBox2)
    $Form.AcceptButton=$OKButton
    $Form.CancelButton=$CancelButton
    $Form.Topmost = $True
    $form1_FormClosing=[System.Windows.Forms.FormClosingEventHandler]{
    if($Form.DialogResult -eq 'OK'){
    if($textbox1.Text -eq ''){
    [void][System.Windows.Forms.MessageBox]::Show('please enter an email address','Validation Error')
    $_.Cancel=$true
    }else{
    # Check empno is all digits
    if("$($TextBox2.Text)" -notmatch '^\d+$'){
    [void][System.Windows.Forms.MessageBox]::Show('please enter a number "999999"','Validation Error')
    $_.Cancel=$true
    $form.add_FormClosing($form1_FormClosing)
    $Form.Add_Shown({$Form.Activate()})
    if($Form.ShowDialog() -eq 'Ok'){
    # return the form contents
    $Form
    if($f=New-InputBox -EmailAddress [email protected]){
    'Email is:{0} for Employee:{1}' -f $f.Controls['EmailAddress'].Text,$f.Controls['EmployeeNumber'].Text
    }else{
    Write-Host 'From cancelled!' -ForegroundColor red
    ¯\_(ツ)_/¯

Maybe you are looking for