In javascript, how can I open a dialog so that the user can enter the value of a variable?

I'm working on a script that will be used for many images, all of them using the same format (size of the image, layout layer, etc.).

All of these images will have a text layer, and what I want is to have the script modifies the horizontal length of the text layer (horizontal percentage scale), it decreases so that all the text appears on the screen, where there is too much of it.

But the text may vary from image to image, and what I want is for the script to display a dialog box have been that the user can enter text that will be on the text layer and scaled down.

Is this possible?

If you want the user to enter then adjust the text while your script is running, here's a way to do it.

var typeLayer = activeDocument.activeLayer;
var type = typeLayer.textItem;
var t = prompt ("Enter text" , "new text");
type.contents= t;
transformLayer();

function transformLayer() {
     try{
     var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('null'), ref );
    desc.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') );
        var desc1 = new ActionDescriptor();
        desc1.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Rlt'), 0.000000 );
        desc1.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Rlt'), 0.000000 );
    desc.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc1 );
    desc.putUnitDouble( charIDToTypeID('Wdth'), charIDToTypeID('#Prc'), 100 );
    desc.putUnitDouble( charIDToTypeID('Hght'), charIDToTypeID('#Prc'), 100 );
    desc.putBoolean( charIDToTypeID('Lnkd'), true );
    executeAction( charIDToTypeID('Trnf'), desc, DialogModes.ALL );
     }catch(e){}
};

Tags: Photoshop

Similar Questions

  • How do my open cam brute 6.7 the CR2 of Canon SX60 open in PS CS5.  He opens the CR2 for my Canon Rebel

    How do my open cam brute 6.7 the CR2 of Canon SX60 open in PS CS5.  He opens the CR2 for my Canon Rebel

    Let me throw you into a fantastic video tutorial for it:

    Camera Raw: How to use Adobe DNG Converter - YouTube

  • How do you open an adobe document that I did on photoshop cc on ios. I want to do it because I want to put this photo on instagram

    How do you open an adobe document that I did on photoshop cc on ios. I want to do it because I want to put this photo on instagram @.

    Ahh, you're probably right, station.

    If this is the case, why even bother with iOS? Instagram don't allow you to download on your desktop?

    @official_knicks: use a file > save for Web save your document open in a format Instagram accepts. (JPEG and PNG formats are, I think.)

  • How to set the value of a variable in automator?

    I'm totally new to automator I found a post that I try to reuse

    to Re: copy multiple files from TextEdit in one Word file

    I want to open a series of html files in a folder and convert in a TextEdit rtf file.

    However, I am unable to automator find out how set the value of a variable such that it appears in this post

    I looked at every command in library without a lot of fortune

    Any help?

    Thank you

    Dan

    Its in Utilities.

    In Automator, use the search box:

  • How to save a pdf file so that the tool pane is not displayed

    How to save a pdf file so that the tool pane does not appear when the file is opened?

    Ah!  Thank you.  You are a star.

  • BlackBerry Q5 how do I put my Q5 so that the reminders (appointments, etc.) are displayed on my home screen?

    How do I put my Q5 so that the reminders (appointments, etc.) are displayed on my home screen?

    Glisser slide down from the top of your home screen, and then select settings > Notifications. Down, you will see blue settings letters lock screen. Click on that and turn the Lock screen Notifications we. Now whenever you have an appointment in your calendar, it will appear on your lock screen date here.

    See you soon.

  • How to apply the procedure inside a procedure and the evils of the value in a variable?

    Hi all

    I'm usung oracle 11g.

    Here is my package and procedure

    I want to call get_email_details this procedure within the process_email_master and store the value in a variable in main proceedings

    create or replace

    PACKAGE ms_gen_process_email

    as

    type email_type is rendered (subject varchar2 (4000 tank),

    email_body varchar2 (4000 tank),

    to_receipent varchar2 (4000 tank),

    cc_receipent varchar2 (4000 char));

    type email_type_table is table of the email_type;

    procedure process_email_master)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    p_action in varchar2,

    p_pid number,

    P_OBJECT_ID in varchar2

    -p_emai_master on p_email_type_table

    );

    PROCEDURE get_email_details)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    P_ACTION in varchar2,

    p_email_type_table1 on email_type_table

    ) ;

    END ms_gen_process_email;

    ----

    create or replace

    PACKAGE ms_gen_process_email BODY

    as

    procedure process_email_master)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    p_action in varchar2,

    p_pid number,

    p_object_id in varchar2

    )

    as

    Start

    null;

    EXCEPTION

    WHILE OTHERS

    then

    null;

    end process_email_master;

    PROCEDURE get_email_details)

    p_metric_name IN VARCHAR2,

    p_current_stage IN VARCHAR2,

    P_ACTION in varchar2,

    p_email_type_table on email_type_table

    )

    as

    BEGIN

    Select the object, email_body, to_receipent, cc_receipent

    bulk collect into p_email_type_table

    of ms_gen_email_config_detail

    WHERE email_key =)

    SELECT email_key

    OF ms_gen_email_config

    WHERE metric_name = p_metric_name

    AND action p_action =

    and current_stage = p_current_stage

    );

    for me in p_email_type_table.first... loop of p_email_type_table. Last

    dbms_output.put_line (p_email_type_table (i) reserve .under | p_email_type_table (i) .email_body: p_email_type_table (i) .to_receipent: p_email_type_table (i) .cc_receipent);

    end loop;

    EXCEPTION

    WHILE OTHERS

    THEN

    NULL;

    END get_email_details;

    END ms_gen_process_email;

    but I get this error message

    Error (15,31): PLS-00201: identifier 'P_EMAIL_TYPE_TABLE' must be declared

    Concerning

    Dale

    See below the test case and change your code. You can call the procedure in detail within a main as procedure below

    CREATE or REPLACE PACKAGE test_pkg AS

    TYPE rec_val IS RECORD (empno, emp.empno%TYPE,

    Ename emp.ename%TYPE

    );

    TYPE nt_tabtest IS TABLE OF THE rec_val;

    PROCEDURE get_email_id (p_type to nt_tabtest);

    PROCEDURE get_email_master;

    END;

    /

    CREATE or REPLACE PACKAGE test_pkg BODY

    AS

    PROCEDURE get_email_id (p_type ON nt_tabtest)

    AS

    BEGIN

    SELECT EmpNo, ename COLLECT in BULK in p_type FROM emp;

    END;

    PROCEDURE get_email_master

    AS

    v_type nt_tabtest;

    BEGIN

    get_email_id (v_type);

    BECAUSE me IN v_type. FIRST... v_type. LAST

    LOOP

    DBMS_OUTPUT. Put_line (v_type (i) .empno: v_type (i) .ename);

    END LOOP;

    END;

    END;

    /

    Post edited by: 000000

  • Can we use the value of a variable in a warning message

    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is that possible?

    Gul says:
    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is that possible?

    Try

    DECLARE err_txt VARCHAR2(200) t;
     al_id ALERT;
     al_button Number;
    BEGIN
    al_id := FIND_ALERT('My_Error_Alert');
    SET_ALERT_PROPERTY(al_id, alert_message_text, 'Hello how are you mr. variable '||:variable_name );
    al_button := SHOW_ALERT( al_id );
    END; 
    

    Hope it works...

    Hamid

  • Open file dialog box freezes the program

    Most of the attempts to open files using the open file dialog freeze the program.  He is a recent problem.  XP is up to date.

    He used to be a stddlg.dll who provided the file open and close services.  Is there something like this in XP, and it may be corrupt?

    Another possible cause for this is the corruption of disk.  A standard maintenance step that should be performed on a regular basis is a disk check.  Try running chkdsk with the ' / f ' or ' / r ' option:

    "How to perform disk error in Windows XP check"
      <>http://support.Microsoft.com/kb/315265 >

    HTH,
    JW

  • I bought a used laptop. How can I clean the computer and only the program that the value of the factory. It's a dv4000 HP clubhouse with windows xp

    I bought a used laptop and the previous ovner couldn't remember his password since it's been more than a year she opened a session.  How can I clean the computer and restore it to that only programs that comes with it when buying or facotry settings.  It's a HP Pavilion dv4000 with windows xp?  I have not all discs.

    Go here: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00006110&tmp_task=useCategory&cc=us&dlc=en&lang=en&lc=en&product=464513 and click on the link that best matches your computer (e.g., Presario, Pavilion and HP Compaq Business PC manufactured and sold in 2006 or later).

    Assuming that your computer is 2006 or later, following the links eventually will lead you to the following directions:


    Reformatting a hard drive should be considered a last resort to solve a problem with a computer system. The hard drive can be reformatted and reinstalled the operating system, using the system PC Suite hard disk recovery. Reformatting the hard drive will overwrite all data on the disk. To preserve the data, back up the data of the user as; letters, leaves of calculation, graphics and emails to an external storage device before you reformat the disk. If the PC does not work in the Windows operating system, see reformatting since the recovery disks .
    Do the following to reformat the hard drive and reinstall the operating system.
    1. Connect the PC to the power adapter.
    2. Close all programs.
    3. Click Start , click principally made programs , select System Restore and click on the PC recovery .
    4. When the recovery options are offered, select the option to perform the Recovery of PC and click Next .
    5. The PC will restart.
    6. When the recovery of the PC of welcome message, click OK to continue.
    7. In the system recovery Panel, select System Recovery . By default, the system will perform a complete reformat and will destroy all user data.
    8. Restart the PC when prompted.
    As alternative method for the steps above, click Advanced Options , select the destructive recovery option and click Next to begin the reformatting process.
    The PC is in original factory State and all data in the system, such as the place and the date must be reconfigured.

    NOTE: any software "trial offer" has been included in the original factory image, it will be reinstalled, but it won't work (the test period will have expired).  If so any trial software is a security antivirus software or others, before connect you to the Internet, you must uninstall (using an uninstall tool provided by the manufacturer if available antivirus software) and then install your own anti-virus software.  So, you should download the uninstallers necessary and installers (or buy the software on CD) using another machine before starting this project.

    NOTE 2: See the following important tips from MS - MVP PA supporter (once the restore is complete, click Start > run > winver > OK to determine what Service Pack you have):

    HOW TO get WinXP SP1 or SP2 fully patched after a 'clean install': http://groups.Google.com/group/Microsoft.public.WindowsXP.General/MSG/a066ae41add7dd2b

    1. download & save the installer for WinXP SP3 on your desktop:
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5b33b5a8-5E7...

    [Yes, you can jump SP2 if you run WinXP SP1.]

    2. read & take into account:
    http://msmvps.com/blogs/harrywaldron/archive/2008/05/08/Windows-XP-SP...

    3 connected as long as administrator, if necessary, double-click the saved file to install WinXP SP3.  Follow the prompts. Be patient and restart twice when the installation ends.

    4. make the resolution method 2 here (believe me):
    http://support.Microsoft.com/kb/943144

    5. go to http://windowsupdate.microsoft.com . Install all required software, and then click CONTINUE. Select CUSTOM and scan | Install the critical updates of security offered. Still, follow all the instructions.

    [I do NOT recommend install IE7 through Windows Update.]

    6. make sure that automatic updates is enabled; FC.
    http://support.Microsoft.com/kb/306525

    Other references:

    Free unlimited installation and compatibility support is available for Windows XP, but only for the Service Pack 3 (SP3), until April 14-09. Chat and e-mail support is available only in the United States and the Canada.

    Go to http://support.microsoft.com/oas/default.aspx?gprid=1173 . Select "Windows".
    XP"and select"Windows XP Service Pack 3 "

    5 steps to help protect your new computer before going online
    [installation clean = new computer]
    http://www.Microsoft.com/protect/computer/advanced/XPPC.mspx

    Measures to help prevent spyware
    http://www.Microsoft.com/protect/computer/spyware/prevent.mspx

    How TO get Windows XP Gold fully patched: http://groups.Google.com/group/Microsoft.public.windowsupdate/MSG/3f5afa8ed33e121c

    1. download & save the WinXP SP2 installer on your desktop:
    http://www.Microsoft.com/downloads/details.aspx?FamilyID=049c9dbe-3b8...

    [Yes, you can jump SP1]

    1B. download & save the installer for WinXP SP3 on your desktop:
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5b33b5a8-5E7...

    2. read & take into account:
    http://msmvps.com/blogs/harrywaldron/archive/2008/05/08/Windows-XP-SP...

    3. administrator, if necessary, double-click the saved file to install Windows XP * SP2 *.  Follow the prompts. Be patient and restart twice when the installation ends.

    3B. logged on as administrator, if necessary, double-click the saved file to install WinXP SP3.  Follow the prompts. Be patient and restart twice when the installation ends.

    4. make the resolution method 2 here (believe me):
    http://support.Microsoft.com/kb/943144

    5. go to http://windowsupdate.microsoft.com . Install all required software, and then click CONTINUE. Select CUSTOM and scan | Install the critical updates of security offered.  Still, follow all the instructions.

    [I do NOT recommend install IE7 through Windows Update.]

    6. make sure that automatic updates is enabled; FC.
    http://support.Microsoft.com/kb/306525

    References with dubbing:

    Free unlimited installation and compatibility support is available for Windows XP, but only for the Service Pack 3 (SP3), until April 14-09. Chat and e-mail support is available only in the United States and the Canada.  Reach
    http://support.Microsoft.com/OAS/default.aspx?gprid=1173 | Select "Windows".
    XP"and select"Windows XP Service Pack 3 "

    Protect your PC!
    http://www.Microsoft.com/athome/security/computer/default.mspx

    Learn how to protect your PC by taking the three simple steps
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=3AD23728-497...

  • How to make 'Open with' to appear in the context menu?

    Establishment of a new Win 7 PC and can't seem to find the setting that controls the options that appear in the selection menu, when you click the right mouse a file in the Explorer window.  I can see the 'Open with' option when you access files in my library folder, but not when I'm in a remote drive.

    I currently see options such as 'Open' and ' send to ', but my other PC Win 7 has additional options such as zip and pdf, which are also installed on this PC, but do not appear in the context menu.  How can I make this work?

    Add to send it to, the menu list.

    http://www.howtogeek.com/HOWTO/Windows-Vista/customize-the-Windows-Vista-send-to-menu/

    New context menu,

    http://www.SevenForums.com/customization/249733-add-items-new-option-right-click-menu.html

  • How can we get value Auto leading

    Hi all

    How can we point, line or character leading Auto value using indesign javascript.

    Thank you and best regards,

    Robert S

    Select a paragraph and try the code below:

    Alert((app.selection[0].pointsize*app.selection[0].autoLeading)/100)

    Vandy

  • Open Save dialog file with the default path

    Hi all

    I want to open a "file save dialog box' with some default path.

    As when the user run this script I want to open a dialog box "save under" with the default path "/Volumes/ < noun > / < folder name > /...» »

    I use

    File.SaveDialog(prompt, filter);
    

    but it does not open in the default location, I want to open.

    Thank you

    Hard

    Look at this thread to see if it can help

    http://forums.Adobe.com/thread/1077267?TSTART=0

  • How can I create a function using variables TestStand and call from Meadow step Expression?

    In one sequence, I have dozens of prior Expressions, which are almost the same thing, like this...

    Locals.tagID = (Parameters.singlePhaseEnabled? ('L': "D") & Str (Locals.phase) & "006".

    .. and the only thing different is this three-digit string in the end ("006" may vary). How can I write a function that I can call from Meadow step Expression then it should look like this? ...

    Locals.tagID = MyNewFunction("006")

    You can not write custom expressions for commands.

    That being said, there are two options:

    • Create a sous-suite with a single step. Use a setting of the sequence as "function parameter.

    • Create a step type custom including a lower level module that implements the function. Add a step edit to allow the user to the steptype graciously change the setting.

    • Store the variable setting in a local global variable / file and change the value in each step. This will, at least, keep the same 'function' for each step.

    Norbert

  • How can I report a number of variable with a precision of 127 type?

    I try to declare a variable with precision - like for example V_NUM NUMBER (1,127).

    According to oracle, it should be possible-

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/sql_elements001.htm#SQLRF30020

    2

    NUMBER[ (p [, s]) ]

    Number having precision p and scale s . Precision p may vary from 1 to 38. Wide s can vary from-84 to 127. Precision and scale are in decimal digits. A NUMBER value requires 1 to 22 bytes.

    but after the execution of the present

    declare

    Number V_NUM (1 127);

    Start

    V_NUM: = 1.2333333333333333333333234343435;

    DBMS_OUTPUT. PUT_LINE (V_NUM);

    end;

    /

    I got error (I know that p must be greater, then s - but I can't figured an example for this case s = 127)

    Error starting line: 1 at the controls.

    declare

    Number V_NUM (1 127);

    Start

    V_NUM: = 1.2333333333333333333333234343435;

    DBMS_OUTPUT. PUT_LINE (V_NUM);

    end;

    Error report-

    ORA-06502: PL/SQL: digital error or value: number too high accuracy

    ORA-06512: at line 4 level

    06502 00000 - "PL/SQL: digital error or the value of %s.

    * Cause: A digital arithmetic error, String, conversion or coercion

    has occurred. For example, this error occurs if an attempt is made to

    assign the NULL value to a variable declared NOT NULL, or if a

    attempt to assign an integer greater than 99 to a variable

    NUMBER (2) declared.

    * Action: Change the data, how it is handled, or how it is so declared

    that values do not violate the constraints.

    Is it possible to reach my goal?

    Ok. I found this ;)

    Thank you

Maybe you are looking for

  • Why can't I watch HD videos?

    When I watch videos on Youtube, I have only the option 360 p for the quality of the video.Also, when I have full screen video on other sites, it remains that 360 p. It is used to switch to HD.On other browsers, everything seems normal.I have the late

  • Printing from Firefox 4.0 is blurred on the Windows 7 machine

    Printing of Web pages and since firefox 4.0 webcontent deforms to the printing of any computer Windows 7. The content is printed, but with a weird spacing that destroys the layout of the content.

  • Satellite L30-149, only works with external monitor and VGA mode

    Satellite L30-149, Windows XP Home Edition Yesterday I did face the following problem: I swithched on my laptop but I have nothing on the screen. I tried to reboot several times, but it did not help. If I look very carefully, I see the logo of Intel

  • HP 2000-2d49TU Notebook PC: automatic system create and close

    Hi team, My system is infected with the virus and my Avast antivirus can't find/fix any virus. I also reinstalled window but it is the same some time my system is create automatic and closed. When I click on any file system is automatic anoter open f

  • Zbook 15 G2: 90W Docking for G2 Zbook 15 HP

    HelloI just got 15 G2 Zbook and currently looking for a docking station as I mainly use with combination of monitor / keyboard/mouse + speaker in my office.As this laptop is big enough with her just as heavy power brick, I realized I'd better go with