How can I get the current state "onto the Pixels?

Hello community,

Here's the function that creates a switch that handles "snap to Pixels":

index.html:

<div id="STP_input" onclick="switchOnOff(this)">
     ...
</div>

main.js:

$("#STP_input").click(function () {
     var a = switchOnOff(this);
     if (a) {
          csInterface.evalScript('switchSTP(true)');
     } else {
          csInterface.evalScript('switchSTP(false)');
     }
});

HostScript.jsx:

function switchSTP(checkBTN) {
    'use strict';
    
    var condition;
    if (checkBTN === true) {
        condition = true;
    } else {
        condition = false;
    }

    var idsetd = charIDToTypeID( "setd" );
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref6 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idtoolsPreferences = stringIDToTypeID( "toolsPreferences" );
        ref6.putProperty( idPrpr, idtoolsPreferences );
        var idcapp = charIDToTypeID( "capp" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref6.putEnumerated( idcapp, idOrdn, idTrgt );
    desc26.putReference( idnull, ref6 );
    var idT = charIDToTypeID( "T   " );
        var desc27 = new ActionDescriptor();
        var idtransformsSnapToPixels = stringIDToTypeID( "transformsSnapToPixels" );
        desc27.putBoolean( idtransformsSnapToPixels, condition );
    var idtoolsPreferences = stringIDToTypeID( "toolsPreferences" );
    desc26.putObject( idT, idtoolsPreferences, desc27 );
    executeAction( idsetd, desc26, DialogModes.NO );

    return;
}

But when I hide the Panel and show once again, that the switch back to the default state, turn on my Panel, not "hook to Pixels" PS settings setting. Is it possible to get the current status 'Hang the pixels' setting? How?

Best regards.

See post 8 in this thread:

Re: Need someone to update or create script: "snap to grid of pixels.

Tags: Photoshop

Similar Questions

  • I reinstalled Firefox Desktop, I downloaded my favorites of Carbonite, how can I get the current Firefox to accept?

    See above

    I reinstalled Firefox Desktop, I downloaded my favorites of Carbonite, how can I get the current Firefox to accept?

    You do backup your bookmark as a .json file?

    Restoration of bookmark

  • Windows 7 Desktop w/printer, my desktop XP in network computer, cannot print bc I wonder for the current print driver, I got a current version, but it does not recognize it? How can I get the printer to work?

    I have a desktop computer Windows 7 connected to an HP laserjet 4050N printer, when I try to print from a computer to Office XP, via the network, I wonder for an updated printer driver.  I downloaded the latest print driver, but it does not recognize the file inf and again requests a current print driver.  How can I get the XP desktop to print on the printer connected to the Windows 7 Desktop?

    Hello

    I suggest you to follow the steps mentioned below and check if it helps.

    Method 1:

    Printer in Windows problems:

    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

    http://h20000.www2.HP.com/bizsupport/TechSupport/DriverDownload.jsp?prodNameId=18322&lang=en&cc=us&TaskID=135&prodTypeId=18972&prodSeriesId=25475

    For your reference: How to use Windows XP to share a printer with other people on your network: http://technet.microsoft.com/en-us/library/bb457001.aspx

    http://TechNet.Microsoft.com/en-us/library/bb456988.aspx

    To connect to a printer on a network: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/print_connect_net_printerw.mspx?mfr=true

    Hope this information is useful.

  • How can I get the tabs to go on a single line and a menu of Firefox?

    Firefox allows to have 2 lines above - Firefox menu with tabs and more and another line of the navigation toolbar. during the installation of some programs online, Firefox now have 3 lines at the top, with the Firefox menu on an entire line, the 2nd line of tabs and 3rd line of navigation toolbar. How can I get the tabs to go on a single line and a menu of Firefox?

    With the current versions of Firefox, you can choose to use the menu of Firefox (orange in windows; gray Linux) button at the left end of the Windows title bar or bar menus familiar as in earlier versions. The Firefox button is displayed by default only in Windows Vista and Windows 7, but you can turn on or off or switch between the two or temporarily show the menu bar when the Firefox button is displayed.

    If you chose to use the Firefox button and you use the default tabs on top, the tab bar will move to the title bar with the Firefox button only when you are to maximize window (the ' square' the middle button in the upper right corner of the Windows standard application window). Other selected toolbars will be displayed below that (bar Navigation, Bookmarks Toolbar and the toolbars you add via Add - ons).

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You must update some plug-ins:

  • How can I get the wwe, Inc. on the slate tablet app 7?

    How can I get the wwe, Inc. app for my hp slate tablet 7?  Some things said not compatible.

    Applications that require a GPS chip in a device won't like the entry level of Slate7 tablet as it does not.  To work around the problem, you will need to 'load side' the program of another Android device that can run it.  She is called extract APK.

    Extraction of the APK is not officially approved by HP. If an application is not available in a specific area which is a restriction that the developer has put on the application. Such a restriction could be due to the licensing of content.

    There are two main steps in order to extract the APK-

    (1) extract the application of another Android device, or download the APK file directly. If you download the APK file also, please be very confident of the Web site. Because you will be "forcing" the application to install and don't not download through Google, it is possible the application has been infected by malware or otherwise damaged.

    To perform step 1, first install the application on another Android device, and also to install an "APK Extractor" application. (there are several to choose from and available for free in the game of Google store).
    Once the application is extracted, copy the file to a MicroSD card, or use another means of transfer for example transfer or by e-mail.

    Insert the MicroSD card into your 7 Slate, or download the file.
    You may need to install a file browser to locate the file on your tab 7. These are also available in the store from game Google free.

    You must change a setting of security on your tab 7; Click settings, security and place a check in "unknown Sources allow installation of applications from unknown sources. You will get a warning about the potential of malicious software by changing this setting.

    Once the security setting has been changed, find the APK file and simply "click" on it to open it. It will install everything as it was downloading from the game store.

    I will state some things well-
    (1) this process is not approved by HP. I am a volunteer here and not an official representative of HP.
    (2) If a request is blocked in your area, then installation can cause problems or even violate certain laws or license.
    (3) download an APK on a suspicious Web site could introduce viruses/spyware/malware or other undesirable behaviors. Do not download APKs for files that are not free Google game like this would be piracy.
    (4) installation of an APK that "requires" GPS may not work fully, although in many cases, you can manually enter in your location and it will work.

    WyreNut

  • How can I get the digital power meter?

    How can I get the digital power meter?

    I use a method similar to the example below to measure the market factor using the inputs of a multifunction data acquisition meter.  If the duty cycle is 0% or 100% for a given period, DAQ reading times out and returns an error.  In this case, I would get the digital state of the counter of entry so I can put as cycle to 0% or 100%.  I want to do it without knowing the digital port and line the entrance of counter... for example I would like to continue referencing DAQ/ctrX since I already have this information.

    The application uses an M series: PXI-6229 DAQ and LabVIEW 2011 to make a system customized for VeriStand.

    https://decibel.NI.com/content/docs/doc-12396

    For the moment I wired the block diagram to add a case structure to check the meter ID and string constants to set the identifier of digital input, as they share the physical connection.  As much as I can say that makes the specific code for the PXI-6229 (or any DAQ with only two counters that share connections with p2.1 and p) 1.4

    I have attached the VI sub.

    When the device is used with a different data acquisition, I can add the connection and/or separate control.  Looks like at least one will be necessary given that the meter can only detect the edges... I think it was the piece of information I needed.

    Thanks for your help!

  • How can I get the original software after I reinstalled the window

    I want to reinstall windows on my laptop, I just want to know how can I get the software provided with this laptop.

    What happened to reinstall window8

    Your laptops support page will be a few, but before installing Windows 8 you did a set of recovery discs so you can return to Windows 7?

    We can get the HP for a set of recovery discs and Once you're back, there is a file on the 'C' drive named SwSetup

    has little almost all software pre-installed that comes with the machine when you were at 7 W.

    Your statement is not clear enough, I hope that I understood it.

  • In windows movie maker, I'm trying to open an old project. It opens, but there is no video clips - only x or empty clips. How can I get the original film clips show?

    In windows movie maker, I'm trying to open an old project. It opens, but there is no video clips - only x or empty clips. How can I get the original film clips show?

    I did a movie and released a dvd. Then, I moved my files from movie on an external hard drive to store files and free up space on my computer. So I went back to try a pull up the project and got every X / white clips. So now, I rebooted my computer with the video files I removed on the external hard drive and it still shows empty clips.
    Help.

    The red Xs indicate that Movie Maker cannot find the original source files.
    If the files are still available... just right click on the red Xs and go to the
    current location of the files source and you may be able to restore the
    path.

  • How can I get the old search wizard on windows vista/windows 7?

    Original title: bringing research research assistant, new bad engine

    Dear all.

    I like Windows XP search assistant as if worked as an engine of 'real' research, for example, bing, google and search keywords.
    The current one is too basic to windows vista and windows 7 is rubbish and doesn't like the old.

    How can I get the old search wizard on windows vista/windows 7?  If I can't do it, how I'd get that to happen?

    Your

    Tom2020

    HI Tom2020,

    If you want to leave comments about the research, please do so at:

    Windows 7 comments

  • How can I get the serial number for Adobe Acrobat XI?

    How can I get the serial number for Adobe Acrobat XI? I have download adobe for free on my laptop dell Inspiron 64 bit Web site.

    It is not free. It is an old version and is no longer sold. You can buy or subscribe to the current version of Acrobat Pro DC.

  • Illustrator will not store my settings. When I re - open the program, my settings are lost. How can I get the program to save my settings?

    Illustrator will not store my settings. When I close and reopen the program, some of my settings are lost; persistent color palettes, type of unit. How can I get the program to save these settings? We have several computers through Adobe CC and one of them has this issue. We have tried to reinstall the program, does not. Looking for someone who has had this experience and has an idea about a solution AND what is the problem.

    Jason

    Check the permissions on your user files. Looks like you have not allowed to save there who HAVE requires that the last thing that made when closing is to write the current version of the preferences.

  • How can I get the name of the procedure

    Hello

    With the help of our application, we update a table (P_Balance) in the statement of account and date thanks to certain procedures.

    in some column of status situation alone expects to obtain the correct value, but the date column with the value NULL.

    Now, we have decided to follow this through which procedure to get this updated value null date column.

    To do this, I decided to write a trigger for the table 'P_BALANCE' by what procedure, this update going on.

    How can I get the name of the procedure.

    Hello

    You can write the call stack in a log whenever the value of the column is null. See

    DBMS_UTILITY. FORMAT_CALL_STACK

    This will give you the name of the object and the line numbers of the update program.

    Concerning

    Marcus

  • How can I get the latest camera raw to Lightroom 4.2?

    How can I get the latest camera raw to Lightroom 4.2?

    You just run the update. If there is a newer version, it will be installed. Except that 4.2 is the latest version out, 4.3 is currently at the final trial staged and can be downloaded from the Adobe Labs page.

    Mylenium

  • How can I get the value of the element checked a box to tick LOV?

    Hi all

    I need to insert rows into a table when a checkbox element is checked.
    The checkbox element is a LOV in a form.
    -----------------------
    Select the DESCRIPCIÓN display_value, ID_DOCUMENTO return_value
    of DOCUMENT
    order by 1
    ------------------------------

    Source
    ------------------------------
    DECLARE
    CURSOR C_REG_DOC IS SELECT ID_DOCUMENTO FROM REGISTRO_DOCUMENTO WHERE ID_REGISTRO =: P6_ID_REGISTRO;
    v_id_documento documento.id_documento%TYPE;
    v_results VARCHAR2 (50);
    Boolean v_first_loop: = true;
    BEGIN
    for this loop C_REG_DOC
    If v_first_loop then
    v_results: = it.ID_DOCUMENTO;
    v_first_loop: = false;
    on the other
    v_results: = v_results |': ' | it.ID_DOCUMENTO;
    end if;
    end loop;
    Return v_results;
    END;
    --------------------------

    I need to create a process to insert rows in a relational table, but I do not know how...
    ------------------
    FOR *? *
    LOOP
    INSERT INTO registro_documento (id_reg_documento, id_registro, id_documento)
    VALUES(null,:P4_ID_REGISTRO,???);
    END LOOP;
    ---------------

    How can I get the value of the active element (id_documento) to insert it?

    Thank you!

    Alex

    Hello:

    You can use the apex_util.string_to_table function to retrieve the values of the LOV as shown in the example

    declare
    arr wwv_flow_global.vc_arr2;
    begin
    arr:= apex_util.string_to_table(:P_CHECKBOX_LOV_ITEM)
    for x in arr.first..arr.last loop
    // insert statement
    iNSERT INTO registro_documento( arr(i) ,.........id_reg_documento,id_registro,id_documento)
    end loop;
    end;
    

    CITY

  • How can I get the messages appear when sent even if my phone is locked. I only get messages across when I activate the phone

    How can I get the messages appear when sent even if my phone is locked. I only get messages across when I activate the phone

    Settings > Notifications > Messages > display on the lock screen

  • How can I get the iMovie video files in the photo library?

    How can I get the video files of "iMovie - bibliotek.imovielibrary" in the photo library?

    Is to select your library from the libraries pane and choose my brackets at the top of the screen. Then select the clips you want and share file on the desktop. Then import in photos.

Maybe you are looking for