How to get user via the command prompt input

I have this work without the prompt, if I under manually through margin var margin = 10; This works. It also seems to return when I print what is the input from the user, but it doesn't seem to work correctly and freezes any idea what I am doing wrong?

It says "expected the value of the point.

//Helper functions


function print(i) {
    if(i == "object"){ 
        print("you are trying to printObject, use printObj(); function"); 
    }
    else {  
        $.write(i+"\n"); 
    }
}


// Program
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;


var doc = app.activeDocument;
var selected = doc.selection;


//print(selection[0].height+", "+selection[0].position);


var selectedHeight = selected[0].height;
print("selectedHeigh: "+selectedHeight);
var selectedPosition = selected.position;
var newItem = selected[0].duplicate( doc, ElementPlacement.PLACEATEND );


print("newitem position: "+newItem.position);
var margin = prompt('enter margin','10');
print("margin prompt: "+margin);


var newHeight = selectedHeight + newItem.position[1]+margin;
print("newHeight: "+newHeight);
newItem.position = [newItem.position[0], newHeight];

Hello hilukasz,

Try this:

//var margin = prompt('enter margin','10');   //you'll get only a String and not a number

//change to
var margin = Number(prompt('enter margin','10'));

Tags: Illustrator

Similar Questions

  • How to get DEBUGGING into the command prompt

    I got to the House and I need to play with DEBUGGING in the CMD.  However, whenever I type "debug" in cmd, I get the following message:

    "A 'DEBUG' is not recognized as a command internal or external, an executable program or batch file."

    I also tried to run CMD as administrator, but that did not help.

    How to enter DEBUG?

    Hello

    By default what is Debug:

    'C:\Windows\System32\debug.exe '.

    You need an assembler.

    This question would be better asked in the MSDN Forums.

    MSDN
    http://msdn.Microsoft.com/en-us/default.aspx

    MSDN - where is the Forum for...
    http://social.msdn.Microsoft.com/forums/en-us/whatforum/threads

    MSDN - Forums
    http://social.msdn.Microsoft.com/forums/en-us/categories

    Assembly language
    http://en.Wikipedia.org/wiki/Assembly_language

    Freebyte's Guide to... Assembler free programming
    http://www.Freebyte.com/programming/assembler/

    Programming in assembler
    http://www.cs.uakron.edu/~margush/306old/index.html

    Using the Microsoft Windows Debugger (WinDbg)
    http://kipirvine.com/ASM/4th/debug/WinDbg/index.htm

    WinDbg
    http://en.Wikipedia.org/wiki/WinDbg

    Download and install the debugging tools for Windows
    http://www.Microsoft.com/whdc/devtools/debugging/default.mspx

    OllyDbg
    http://www.OllyDbg.de/

    The place on the net to learn Assembly
    http://homepage.Mac.com/randyhyde/Webster.cs.UCR.edu/index.html

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • How can I change text size and point via the command prompt?

    I want to create a script that will allow me to easily change to or from my TV to my monitor. I know how to change the display, but I don't know how I can change the size of text and point via the command prompt (that is, from 100% to 150%). Does anyone know how?

    Unfortunately, you can not.  In addition, change the DPI requires reboot (or logout and back).  But you can apply a different theme, that you can call from the command just by opening the .themepack file.  Since themes can control the size of some elements of the police who might do the trick you are looking for.

  • Satellite L - can I add new accounts via the command prompt?

    Is it possible that I can add new accounts to the machine via the command prompt on the screen of "recovery"?

    (When you start in recovery mode and select command prompt)

    I tried the normal commands "net user username / add ', but the accounts are not added to the machine.

    Y at - it another command which can be used?
    Thank you.

    Hello

    I don't know if it will work using the in my opinion Mr. recovery console, it is not possible.
    As far as I know that you can add the user and the password using the CMD, but this might work only when the Windows operating system has been loaded.

    In this case, you can use this command to add the user account: + net user username / add +.
    If you want to add a password for the user account, then you must use this way: + net user username password / Add +.

  • Delete the registry via the command prompt keys

    I uninstalled a program on my computer, and I want to remove all the remaining files, registry keys and values of that particular program to the registry via the command prompt. Y at - it a command line that can scan and remove all the remaining files, registry keys and values of this particular program of the whole registry via the command prompt in only once.

    Please help me.

    If the uninstall program is correctly written, then it will do it all. If this isn't the case, you will have to do it manually. Although it is possible to write a script that will scan the registry for some channels, it is not a trivial task. Running one such script would be quite risky because it could easily delete the wrong registry key.

    Also note that the unused files or registry keys not used do not slow down a machine, contrary to popular belief. Purge of these undesirable things might give you a welcome warm feeling inside, but he has no effect on the performance of the PC.

  • generate the fmx via the command prompt

    Hello

    I use Oracle forms6i, Oracle Database 10 g and Windows (OS).
    Is it possible to compile the FMB file via the command prompt.
    And then I need to move the files to the server fmx via the command prompt.


    Thank you
    Eliane.

    Published by: Sophie on January 24, 2012 17:20

    Eliane says:
    Hello

    I have created the batch file as directed by your code and I changed only the useridn/password@db.
    I have run the package
    But I can't find the fmx file.

    Sorry I post the compiler in batches of 10g

    Go where u run the batch file? It should be in this folder where you .fmb exist.
    So then do not work. Add the path before the ifcmp60.exe
    This is the compiler 6i

    Echo compiling forms ....
    for %%f IN (*.fmb) do C:\ORANT\BIN\ifcmp60.exe userid=mail/tti@ait module=%%f batch=yes module_type=form compile_all=yes window_state=minimize
    ECHO form compilation complete
    

    change the path of the ifcmp60.exe you have
    Hope it works for you

    If someone useful or appropriate, please mark accordingly.

    Published by: HamidHelal on January 24, 2012 20:12

  • How to get assets via the REST API (Webcenter Sites)

    Hello world

    I need to get assets via the REST API using Javascript, but I don't know how to open a session. Can someone explain to me how do?

    I would really appreciate it.

    I also followed this guide Oracle Webcenter REST API permission | Stories of official codification but does not work.

    Best regards!

    Hello rvillamarin,

    Take a look at https://docs.oracle.com/cd/E29542_01/doc.1111/e29634/wemsecurity.htm#WBCSD306. With this, you should be able to get a ticket, to pass at the request of the REST.

    Kind regards

    Stephan.

  • How install Flash Player via the command line using sudo to install without being invited for the dialog "Preferences updated Flash Player"? Is there a really quiet option, no prompt?

    Since the administration guide, I execute the following commands on a remote host to install flash player. However, the command stalls waiting for "Update Flash Player Preferences" dialog box to decide. I would like to run this command on a remote host and have to install without any warning. Are the other arguments to the "'Adobe Flash Player install Manager" another that '-install ', something that is really quiet? "


    Silent installation of Flash Player (using Installer .app bundle)

    To silently install the Flash Player 11.3 or later on Mac, follow these steps:

    1 extract the bundle to install Adobe Flash Player (install Adobe Flash Player.app) of the. DMG file.

    2 open a terminal window and change to the directory where the .app file is saved.

    For example, if the .app file is saved to the desktop of the current user, type:

    CD ~/Desktop

    3. run the installation program contained in the .app file using the following command:

    sudo. / Install Adobe Flash Player.app/Contents/MacOS/Adobe Flash Player install Manager.

    install

    4. type the password to continue the installation.


    Thank you.

    Hello

    You experience this behavior because you use the installer online, download and install Flash Player silently in background, but requires also the user to provide the option to update.  Setup Online is not intended for the distribution of the company.  Distribute Flash Player within your organization, you will need Flash Player (usually free) licenses for distribution.  Apply for a license, go to Adobe Flash Player Distribution. Adobe and complete and submit the form.  After application, you will receive an email with a link to download installers for the distribution of the company.  This includes installers .app both .pkg you can use.  None of these prompts to update the options during installation in silent mode.

    I apologize for not noticing this before, however, I assume that you did not use the installer online since you were distributing Flash Player within your organization.

    --

    Maria

  • How can I make SUST recovery of windows vista Home premium via the command prompt. My laptop is Hp pavilion dv5. Meet _ @ _. ___

    The laptop is Hp pavilion dv5. I have no recovery discs. The notebook exploded when I downloaded the updates from kaspersky.

    Hello

    Contact HP and ask them to send you in vista recovery disks to reinstall the operating system back as it was when you bought it

    they do it for a nominal cost of $

    ____________________________________________________________

    or press F11 at startup:

    Restore the PC to its original state with the HP Recovery Manager if Windows Vista is not accessible

    If the PC does not start under Windows, it may still be possible to use the HP recovery disk to restore the computer to its original state. The Recovery Manager can be started during the boot process by following the steps below.
    1. Press on the button / stop to start the PC and press the f11 key when the standard BIOS guests appear on the black screen.
      NOTE:  By pressing the f11 key at startup on a computer with an image factory HP will start the system recovery process, even if the message is not displayed.
      • If the HP Recovery Manager can access the recovery on the hard drive partition, you receive a to back up user files before you start the recovery prompt. Follow the instructions.
      • If the HP Recovery Manager cannot access the hard disk to resolve system errors, you need to use the recovery disk custom that you created to recover the hard disk to its original state.
      • If you have not created the custom recovery disk, or disks are damaged, you can order a replacement of HP recovery CD.

    2. When the Recovery Manager starts, follow the instructions of recovery step by step , shown above.

    _______________________________________________________________

    Try this to solve your problem instead of relocation:

    try a restore of the system before this happened

    http://www.windowsvistauserguide.com/system_restore.htm

    If necessary do in safe mode

    Windows Vista

    Using the F8 method:

    1. Restart your computer.
    2. When the computer starts, you will see your computer hardware are listed. When you see this information begins to tap theF8 key repeatedly until you are presented with theBoot Options Advanced Windows Vista.
    3. Select the Safe Mode option with the arrow keys.
    4. Then press enter on your keyboard to start mode without failure of Vista.
    5. To start Windows, you'll be a typical logon screen. Connect to your computer and Vista goes into safe mode.
    6. Do whatever tasks you need and when you are done, reboot to return to normal mode.
  • How to get edit MS DOS command prompt to work under Vista?

    I'm running Windows Vista Home premium 64-bit. I can not load edit in command prompt to some college assignments. Why my guest tell... "not an internal or external command. not a bat file. » ??? How can I change order work?

    How can I CHANGE order work?

    In short... you can't.
    The old EDIT.COM DOS command came as an additional command that reside in a directory of BACK for 16-bit (8 bits?) Shell COMMAND.COM and QBASIC. EXE. The command window, you use in Vista is a shell 32-bit CMD.COM that does not include support EDIT.COM or QBASIC. EXE.

    If you really want to try COPY CON of the old school. If that won't do, provide clarification on what you try to accomplish without notebook and get other tips may be able to offer.

  • 11.1.1.3 planning batch report planning via the command prompt

    Hi guys. We are under planning 11.1.x, and have a bunch of statements of lots that are implemented using batch Scheduler. I want to be able to run reports of individual lot of a command batch on the server prompt. How can I do this? I see that there is a way to export to command line or something like that batch Scheduler but do not know how to proceed.


    Thank you.

    Reading of:-http://download.oracle.com/docs/cd/E12825_01/epm.111/fr_user/ch15s05s02.html

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Change the attributes of the file via the command prompt

    Hello

    I have just read and followed, Tricky300 answer to the previous question above on May 5.
    I want to remove attributes only reading of a folder named Musicmaster located on a memory stick in my E drive.
    This is a backup of my iTunes library.
    I have no problem to access this drive.
     
    I followed (I think) the solution, in the example given on the Microsoft site.
    I typed in the following attrib-re:\musicmaster\*.*/s
    "" After pressing enter the message I get is, "path not found".
    What am I doing wrong please
    Thanks in advance.
    Jeff Kennedy

    I followed (I think) the solution, in the example given on the Microsoft site.

    I typed in the following attrib-re:\musicmaster\*.*/s

    Perhaps a fault of typo, but you must leave a space between the command, switches, and the full path:

    attrib - r e:\musicmaster\*.*/s

    attrib [space] [-switch] [space] [path] [space] [switch]

    John

  • Deploy WAR file via the command prompt

    Dear all,

    I had implemented a Service of Web PLSQL and deployed Oracle 10gAS.
    I have the same deployment using the file. War and the deployment by using the command line. Is it possible... ? If Possible, how can I do this...?


    Thanks in advance...

    Please also indicate what can I use the same command to deploy a .ear also file... ?

    Take a look at the doc. He must show that the same utility and command can be used to deploy an EAR file. There may be a small difference in the syntax because you must specify the command - bindAllWebApps to say the Deployer to bind all web modules in the web site by default.

    -steve-

  • is there a way to tell firefox allow and remember the java plugin for all users via the command line or a script?

    Hello

    I have about 200 computers I want to push the next to parameter

    allow and remember the java plugin for firefox for all users
    

    is it possible to do this via a script or configuration file?

    You must create two files in the Firefox program folder.

    • local - settings.js file in the defaults\pref folder where you will find the channel - prefs.js
    • mozilla.cfg in the main folder of the Firefox program
  • How to delete files using the CMD prompt

    I have problems with the Vista boot, to the point that I can't even get into safe mode or use the Vista disc to reinstall Vista.  However, after searching several forums, including this one, I found instructions in order to use an ide cable to usb to connect my hard drive to another computer.  In doing so, I was able to access all files on the hard drive, so it seems that it's an OS problem, rather than a hardware problem.  Positions listed several files in Vista to remove via the command prompt which seem to be the cause of the problem I'm having, but when I try to do, I get a message that says: 'access denied '.  How to remove the files of Vista in this way?  A few messages mention "taking possession" of these files, but he was very confused (and tedious) way they described.  is there a simple way to layman to delete these files?

    Thanks in advance for your help.

    "Access denied" means that you were NOT in the administrator command prompt.

    Right click on cmd > click on Run As Administrator > now continue with what you have to do... For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

Maybe you are looking for

  • Error "unable to parse your stream.

    I am trying to submit an rss feed for my podcasts and get an error saying that nothing more that 'can not analyze your flow. Can someone give me an idea of what is wrong? My rss file can be found at http://www.unsignedradio.rocks/rss.xml Thanks in ad

  • The 1-754-399-11 antenna works with CMT-CX4iP for the FM reception

    Is antenna 1-754-399-11 work with this drive - CMT-CX4iP?

  • Update can download and installation

    I'm having a problem of auto update with an update for windows vista (KB972145)This update now moved successfully 3 times now and it just download again ready to settle down again.I don't want to hide the update, because I think that I won't get the

  • Ask for password when the computer starts

    While I start my computer, directly a black screen comes with password request. Even I press the keys to boot options. Please give me the Solution

  • Compatibility of software engineering in Windows 10

    I am currently on a Windows 7 platform and run software of engineering CAE/CAD such as Abaqus CAE, Atair Hyperworks, Catia, etc.. They are all compatible 8.1 windows, they would be compatible on windows 10 pro? Concerning DB