How to communicate between ExtendScript and basic generator

I run a separate node server as described in this tutorial to create a plugin with generator-core. http://tomkrcha.com/?p=3896

I'm in a situation where I need to send a lot of JS to photoshop via generator.evaluateJSXString (). But it can easily become uncontrollable that you can send a string. So, for any complicated feature, it becomes difficult to maintain. Is it possible set a bunch of functions in a script to measure file and then call these functions from the application node?

So I could send:

generator.evaluateJSXString ('doSomeStuff ()');

And in a script somewhere (I don't know where this script should go)

I have the defined function that can do something

function doSomeStuff() {}

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

doc.artLayers.add ();

}

}

Where the Script to extend file would in this case? OR is there a better way to make this kind of thing.

Just a mixed collection of thoughts:

  • Yes, you can package scripts in the form of .jsx files (also jsxbin if you prefer not to share the source) and run with generator.evaluateJSXFile (path), which will work even in ESTK. It has some limitations

    • It is just a file that runs, that is not this function 'call '. I managed this by dividing my Javascript libraries and plugins (= this a function). Can I use Gulp to concatenate libraries necessary for each plugin to create scripts of jsx 20 + that I call the two panels of node & Photoshop
    • There is no parameter passing, but it can be overcome by the presence of a script (that you run a string) parameter store (or fetch result) to Photoshop as a descriptor of persistent custom action
  • The plugin folder where your main.js is accessible by Node.js variable '__dirname '.
  • Depending on how you use paths, you should consider Windows "------" vs. Mac ' / '.
  • Another good way of communication between the panels of Photoshop and the node is a Web server in the configuration node and use Ajax/jQuery in Panel of Photoshop. You can do ~ 500ms update on election and get feedback from Panel pretty real time.

Tags: Photoshop

Similar Questions

  • How to communicate between JSP and jsf/jspx/managed bean using ADF11gR2

    Hello

    Scenario1.

    I use Jdeveloper 11 g R2, I am developing an application in the ADF. In our application, we implement of payment gateway.
    Application of the ADF, we call payment gateway.
    inside the payment2.jspx
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    * < af:commandButton text = "#{res ['makepayment_2.totalpaymentthroughknet ']}" id = "cb1" action = "#{makePayment2.callPaymentGatway}" / > * "
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PaymentGatwayManagebean Method callPaymentGatway()
    public void callPaymentGatway() {
    > System.out.println ("Hi callKnetMethod method called");}
    > String payUrl, payId = null;
    > HashMap hm = new HashMap();
    > HttpServletRequest request = (HttpServletRequest) (JSFUtils.getFacesContext ()) .getExternalContext () .getRequest ();
    > logger.info ("-> callKnetMethod method called");
    > hm = KnetUtils.knetInitialize ("1", "2", "3", "4", "5", "6", "7");
    > payUrl = (String) hm.get ("PayUrl");
    > payId = (String) hm.get ("PayId");
    > request.setAttribute ("knetRedirect", "true");
    > try {}
    > KnetUtils.knetPay (payUrl, payId);
    >} catch (Exception e) {}
    > e.printStackTrace ();
    {>}
    }
    the above method called Paymentgateway after response from gateway payment successful return transaction with some data as the id of the transaction, the name of the Bank, amount, train etc. all data by adding to the URL
    Exodus http://192.168.102.41:7101/amificweb/faces/ami/repback.jsp?paymentId="+paymentId+"& result ="+ result +"& auth ="+ auth +"& ref ="+ ref +"& postdate ="+ post +"& trackid ="+ trackid +"& amp; tranid = "+ tranid + ' & udf1 =" + udf1 + ' & udf2 = ' + udf2 + ' & udf3 = "+ udf3 +" & udf4 = "+ udf4 +" & udf5 = "+ udf5;

    *Current repback.jsp page*
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    < %
    Payment gateway data take into repback.jsp
    > String paymentId = request.getParameter("paymentid");
    > String ErrorNo = request.getParameter("Error");
    > String udf1 = request.getParameter("udf1");
    > string udf2 = request.getParameter("udf2");
    > string udf3 = request.getParameter("udf3");
    > string udf4 = request.getParameter("udf4");
    > string udf5 = request.getParameter("udf5");
    > System.out.println (request.getParameter("result").toString ());
    > if (request.getParameter("result").equalsIgnoreCase ("CAPTURED")) {}
    > result = request.getParameter("result");
    > are later = request.getParameter ("postdate");
    > tranid = request.getParameter("tranid");
    > auth = request.getParameter("auth");
    > trackid = request.getParameter("trackid");
    > Ref = request.getParameter("ref");
    >
    > out.println ("REDIRECT = http://192.168.102.41:7101/amificweb/faces/ami/*voucherPrinting1.jsp*?paymentId="+paymentId+ "& result =" + result + "& auth =" + auth + "& > Ref =" + ref + "& > postdatent =" + postdatent + "& trackid =" + trackid + "& tranid =" + tranid + "& udf1 =" + udf1 + "& udf2 =" + udf2 + "& udf3 =" + udf3 + "& udf4 =" + udf4 + "& udf5 =" + udf5 "); {
    } else if (request.getParameter("result").equalsIgnoreCase ("CANCELED")) {
    > result = request.getParameter("result");}
    >
    out.println ("REDIRECT =http://192.168.102.41:7101/amificweb/faces/ami/Error1.jsp?paymentId=" + paymentId + "& result =" + result + "& ErrorText =" + ErrorText);
    >}
    > % >
    -
    In the present scenario I can redirect from repack.jsp to voucherPrinting1.jsp and I can take all of the data in the jsp page.

    But I want all the data * CallPaymentGatwayManagebean * method, how can I do. ?

    How communication between jsp and jsf, jsff, jspx, managedbean?



    Maroof

    You must save the config.xml file adfc bean in the scope of the request this ways you can call the method any page bean.

    Also have you tried using the pages in a taskflow with jspx and saving the bean in the taskflow which is a better approach?

  • How can I communicate between MUSE and animate CC OEM element?

    Hi all

    Please let me know how can I call the Muse javascript function (written using the object > option Insert HTML code) by a click of a button.

    This button has been designed and coded using CC animate and its OEM file has been imported in MUSE.

    Basically, I'm looking for a solution communicate between MUSE and OEM, and vice versa.

    Help, please!

    Thank you

    AshishK

    There is no adequate way to do file OAM control over site of muse. In fact, even a simple button OAM is a html document independent, which has a head, body and its own scripts and html code. OAM - is a site within your site are located in an iframe. This format is used for banners and animations for beauty, but not for the features. If you need the functionality, you must export your animation in html and javascript, disassemble the part code and integrate the muse - something on your mind, in the body. And of course, you have to understand with in the code. But even for a experienced, coders this approach would be absurd. It is easier to make a simple button in cssto integrate this a whopper for the site, which would create a disproportionate burden

  • How to communicate between different applications on 1 Server?

    As the title says: how to communicate between different applications on 1 Server?

    I'm new to FMS and I am trying to build a program that I need to have a communication between 2 or more applications on the same server.

    How to do this?

    There are several ways to do so.

    1. the favorite for me is make a NetConnection instance of an application to another and make calls between the two using .call NC on one side and client.call interface on the other side

    2. you can use the objects proxy shared to affect this change even

    3 build your own interface for that use the remote features

    Just some thoughts.

    ASA

  • How to communicate between AEGPs?

    Hi all

    Is it possible to communicate between AEGPs? I know that by adding more, we can communicate between effect and ECAP. We can also communicate between AEGPs with the Suite?

    Thank you and best regards,

    Dheeraj

    Yes, a custom suite is the way to go.

    Wait with the help of the suite after you are sure al the AEGPs loaded, otherwise you can try to use the suite before it has been set.

    you do not have this problem using a suite in an effect because AE loads AEGPs first, and then only the effects.

    the first call of idle would be a good time to load more.

  • How to convert between p1 and p1raw in v$ session_wait?

    We have a tool on v$ session_wait showing only p1 instead of p1raw. For a wait as free lock, I need to know the p1raw. But how to convert between p1 and p1raw?

    example of v$ session_wait:
    P1 675562835
    p1raw 28444553

    I tried to use rawtohex (p1raw) = rawtohex (28444553) = 3238343434353533, which has nothing to do with the real p1. Someone has an idea?

    Thank you
    Daniel
      1* select distinct sid, p1, p1raw, TO_char(p1,'XXXXXXXX') from v$session_wait
    SQL> /
    
           SID        P1 P1RAW    TO_CHAR(P
    ---------- ---------- -------- ---------
           159 1650815232 62657100     62657100
           163       300 0000012C          12C
           166       300 0000012C          12C
           160       100 00000064           64
           161       300 0000012C          12C
           162       500 000001F4          1F4
           164     180000 0002BF20        2BF20
           165       300 0000012C          12C
           168       300 0000012C          12C
           152         0 00            0
           167       300 0000012C          12C
    
           SID        P1 P1RAW    TO_CHAR(P
    ---------- ---------- -------- ---------
           170       300 0000012C          12C
           169       300 0000012C          12C
    
    13 rows selected.
    

    See a pattern here?

  • How to communicate between the host and the guest in a stand-alone PC

    I have a professional Standalone XP (host) that is not connected to a network. I created a host (XP Professional) using vmware. Pls know me how to communicate and transfer files between the guest and the host.

    Pls post the procedure or send it to [email protected]

    Thanks and greetings

    Ganesh.

    Use "NAT" or "Host-Only' networking for your virtual machine, NOT bridged.

    Activate a shared folder on your virtual computer configuration, map as a network of virtual machine of your shared folder on the host drive.

    Good bye

    Riccardo Riva

    VCP, RHCE, FCNSA

    If you have found this or other useful information, please consider awarding points to 'Correct' or 'useful '. Thank you!

  • How to communicate between instances of Labview application?

    Hello, I have a question on how to communicate data between two instances of labview application on different computers connected via a network.

    I'll explain what I'm doing:

    I have a data acquisition program that was divided into two independent parts. The backend is responisible for the acquisition of data from several DAQ hardware, and the interface simply displays the data collected. The two parties are coupled by events in labview. The backend sends a new event data (for any one listening) whenever he gets new data and the frontend listens to these events and updates of some graphics on the front panel each time it receives this event. Other than the two parties have no communication.

    Now it is necessary to split the frontend and backend on two different computers, connected via a network. The backend will be connected to DAQ devices as usual, but the frontend is running on another computer.

    So my questions are: will be the my current communication mechanism still work on multiple instances of labview application? And if not, what is the best way to connect the two in a minimum amount of new code, and without interrupting the current program, if I decided to their port of return on the same computer?

    (I thought that a kind of middle-man would be the best who is responsible for networking).

    Please, any advice will be useful!

    Paul.

    I think that the best way to do this is a TCP/IP link.  You can do it, as you suggested, with a pair of 'intermediate' screw at one end, catch you user events in a VI and send them over the network; on the other end, you receive data and turn it into an event, requiring minimal changes to the rest of your code.  The TCP/IP screws are pretty easy to use and there are good examples of LabVIEW.  NEITHER offers the Simple e-mail reference library.  You can also watch "robust TCP' Jack Hamilton of LabUseful.com (WARNING: I've never used or not even watched these screws and cannot check they are really helpful, I have seen discussion and links to them).

  • Display satellite C50-A546 cards how to switch between NVIDIA and INTEL?

    Hello

    How can I switch between NVIDIA and INTEL graphics cards?

    PS
    I have already installed all the drivers, but I can see that INTEL the card used chart!

    * OS: Windows 8.1 x 64
    * NVIDIA driver: 340, 52-portable
    * DirectX: 11

    Hello

    The Intel graphics chip, which is part of the central unit should be used for low performance applications, because it allows you to save energy and reduce the internal temperature.

    For best performance while game, it s advisable to use the external GPU (nVidia or AMD)
    This setting can be changed in the nVidia control panel s

    Here, you should choose manage them 3D settings (can be found on the left in the nVidia control panel)

    Now in the main window, you will find two global settings and program parameters tabs
    In the program settings tab, select the (game) program that needs to use the nVIdia GPU

    If it is not listed, click the Add button
    Then choose the graphic processor preferred for this program (generally must be nVidia processor high performance)

    Last but no less, in this program-specific settings, you can assign additional features to improve performance.

  • How to communicate between clients?

    Hi all

    Of course it can be done with Flex after seeing the internet meeting room request which is developed by Adobe. And my goal is similar to that. One of the clients is the host which acts as an information centre, while all other customers can read/write data with the host. As far as I know, there is a LocalConnection object. But customers are located in various locations, how can we share LocalConnection? Or y at - it another way to reach my goal?
    All the tips and ideas are appreciated. And more detailed the better.

    Thank you and best regards,
    Felix

    You will need a server. BlazeDS is open source free alternative to LiveCycle Data Services business and more capable.

    And it's not BlazeDS * just * bridge between java and flex. It is a lot more particularly with its real-time e-mail close. And that's what you're looking for.

    Read and run these demos:

    http://coenraets.org/blog/2008/04/Yahoo-maps-collaboration-using-Flex-and-BlazeDS/

    http://www.Adobe.com/devnet/flex/articles/yahoomaps_collaboration.html

    and finally, click this URL in two separate browsers:

    http://coenraets.org/samples/flexmaps/flexmaps.html

    Connect and start playing!

    ATTA

  • How to connect and communicate between PXI1031 and PLC Controllogix?

    I would like to know how to develop communication between the CAP/PXI with PLC, using the Ethernet switch.

    What is the add-on hardware or software necessary?

    I found some useful information through a video:

    http://zone.NI.com/WV/app/doc/p/ID/WV-11/nextonly/y

    Please do not hesitate to give your suggestions and any other information or thing for the same experience.

  • UserEvents to communicate between subVIs and a main VI

    Follow-up to http://forums.ni.com/t5/LabVIEW/2-parallel-state-machine/m-p/3247857#M946309

    You want to start 2 parallel state machines. It was suggested to use UserEvents

    Mainvi:

    Subvi:

    I have 2 questions:

    1)

    Am I right in when is to say that I can place my machine of the State in the Subvi instead of the random generator and waveform table?

    2)

    How to start Subvi with arguments?

    Michael.Koppelgaard wrote:

    Follow-up to http://forums.ni.com/t5/LabVIEW/2-parallel-state-machine/m-p/3247857#M946309

    You want to start 2 parallel state machines. It was suggested to use UserEvents

    I have 2 questions:

    1)

    Am I right in when is to say that I can place my machine of the State in the Subvi instead of the random generator and waveform table?

    Yes, a way if you create your state machine using a shift register (with Enum or string) located on the while loop around the structure of the event. Note that the time-out period of the structure of the event that creates random numbers at certain intervals. You may have your DAQ here. Of course, there are other options, such as the use of two parallel loops in the Subvi, the top loop only for the GUI and dynamic events, and lower node would make data acquisition and even hold the state machine logic...

    2)

    How to start Subvi with arguments?

    Also have a look at how I did in my example project: I call the Subvi with two arguments: an ID (digital U32) and the cluster typdef holding the UserEvents references. Easy to create another entry point for this sub - VI, as a cluster that could contain several parameters (as parameters DAQ, ports COM, device ID, etc...). After you change this Subvi, remember to update 'Type specifier VI refnum (for type only). You can right click on this object and browse your set up-to-date the Subvi, so the new input terminal "appears" on the icon 'start the asynchronous call.

    EDIT: start designing your state machine in the Subvi and later, after your VI in order to comment and you help if you need.

  • How to switch between levels and curves

    I'm going through a whole bunch of old photos of black and white box-Brownie and change most of the corrections that I made with levels of curves. I want to be able to switch between the applied image with levels and curves applied to observe the difference. Is it possible to do it with a key? If so, how?

    Maybe you should look into layers.

  • I can communicate between PC and cRIO throughout the series?

    I'm new to the compactRIO. I have a lot of experience with the old Fieldpoint hardware. I understand that they are essentially diffeentliy. The RIO has its own processor and can run stand-alone programs. The Fieldpoint was really just IO for a PC.

    I'm trying to communcate with my RIO (OR cRIO-9074) on the serial port. Is this possible as on the Fieldpoint? Or is the serial port on the chassis of RIO just for interfacing to a different serial device? I'd rather do not to use the ethernet port if possible.

    Hey tir38!

    You can make a serial between devices using the serial port on the chassis of the cRIO. The port is usually referred to as COM1 on the chassis and you can program using the Standard Serial VI (VISA VISA Read.vi, Write.vi, etc.). That being said, you don't have to have a VI running on the target to manage this communication. But when it comes to code to the target deployment and configuration of the target through MAX, you must use an ethernet cable.

    I hope that solves your problem!

  • How to communicate between two screens

    hiiiiiiii refugees...

    Today, my task is a communication between two screens...

    I created a screen that I view the image and the name of the image...

    control of the screen, it is in the two screen...

    Please tell hw to switch returns it an amusement value in two screen display a...

    The best way would be something along the lines of:

    Screen1.Java

    SerializableAttribute public class Screen1 extends {}

    ...

    public void updateScreen (int value) {}

    update of the screen accordingly using setText, setBitmap, setLabel and other

    ...

    Invalidate(); Maybe not even that - the screen will be repainted once you jump Screen2

    }

    in response to the pressure of the button

    Screen 2 scr = new Screen2 (this);

    UiApplication.getUiApplication () .pushScreen (scr);

    ...

    } / / End of Screen1.java

    Screen2.Java

    SerializableAttribute public class Screen2 extends {}

    ...

    private _parent Screen1;

    public Screen2 (Screen1 parent) {}

    Super();

    _parent = parent;

    ...

    }

    In response to the button that is clicked

    _parent.updateScreen (valueAssociatedWithThisRadioButton);

    ...

    } / / End of Screen2

Maybe you are looking for