Selection coordinates

Hi. I need to have the coordinates of a selection area (not rectangular one). I've searched the net and only found this script:
                                doc.Selection.MakeWorkPath(1);// make the path 
                                PathItem p = doc.PathItems["Work Path"];
                                for (int u = 1; u <= p.SubPathItems.Count; u++)
                                    for (int t = 1; t <= p.SubPathItems[u].PathPoints.Count; t++)
                                        PathPoint w = p.SubPathItems[u].PathPoints[t];
                                        object[] my = ((object[])w.Anchor);
                                         int myx = Convert.ToInt32(my[0]);
                                        int myy = Convert.ToInt32(my[1]);
but it's not working as I have no experience with PS scripts. I've saved it as .jsx and tried to load it but it throws errors like it can't set a variable  of the "PathItem" type and such. The script is obviously not completed, after it executes i need a way to obtain the outputted coordinates (text file, area, output window..)
Can anyone help me out ?
Thanks beforehand

#target Photoshop
var data=mapa_seleccion(activeDocument,data)
function mapa_seleccion(doc,out){
     var hs = doc.historyStates;
     preferences.rulerUnits = Units.PIXELS;
     doc.selection.makeWorkPath(1);
     var p = doc.pathItems["Work Path"];
     var a = new Array();
     var t = 0;
     var l = p.subPathItems.length;
     for ( k = 0; k < l; k++) {
          var n = p.subPathItems[k].pathPoints.length;
          a[k] = new Array (n);
          for ( i = 0; i < n; i++){
               a[k][i] = new Array();
               a[k][i]=p.subPathItems[k].pathPoints[i].anchor;
     var t = 0;
     for ( k = 0; k < l; k++) {
          var n = a[k].length;
          var s = 0;
          for ( i = 0; i < n; i++){
               var j = (i+1)%n;
               s+=(a[k][i][0]*a[k][j][1]);
               s-=(a[k][i][1]*a[k][j][0]);
          s/=2;
          t+=s;
     doc.activeHistoryState = hs[hs.length-2];
     out=new Array()
     out.mapa=a
     out.area=parseFloat(t/doc.resolution/doc.resolution*2.54*2.54).toFixed(2)//convierte a cm2
     return out
//You can get the area of the selection with:
alert(data.area)
//The "selection" is an array, so you can get it like:
data.mapa[0] // for the first subpathitem
data.mapa[0][0] // for the first pathpoint in the first subpathitem, etc.

Similar Messages

  • 3D plot - select coordinates

    Hello,
    I would like to know if there is a way to know the coordinates on a 3D surface plot in LabVIEW. Actually I know one way but I would like to know if there is another. The way I know is: right click on the 3D plot and then click on ´Properties of 3D plot´. Then click on ´Cursor´ and finally set the X, Y and Z positions to the desired point on the plot. I have attached a few images showing this. I have also in the Blockdiagramm a PropertyNode that shows the selected coordinates.
    OK. Now, my question is...Is there a way to select a point just clicking on the graphic?? (without right clicking and selecting ´Properties´ and so on).
    Thank you very much in advance,
    Claudia
    Attachments:
    3Dplot.jpg ‏132 KB
    Properties.jpg ‏254 KB
    Property-Node.jpg ‏23 KB

    Hello ClaudiaRamos,
    I did some research and wrote a small VI to test these cursor things.
    Unfortunately, I just could do it like you. I am afraid, it is not possible to click in the 3D diagram and have the x, y and z value output.
    (Come to think about it: how should the computer know where you click? The mouse is not a 3D input device and there can be more than one point in the 3D room you could "mean" with your click - which one should the computer take?)
    Also, I have a question: should the point you select be on the surface of you graph, or anywhere in the diagram?
    I think the way we are trying just selects any point, regardless if it is on the surface of the plot, or not.
    I am sorry I cannot give you a solution at this point now.
    Best regards!
    Christopher W.
    Intern Application Engineering | NI Certified LabVIEW Associate Developer (CLAD) | NI Germany

  • Save selection coordinates - simple nerdy script

    Hello,
    I've uploaded a little illustrator script that might be handy to some.
    Ideally designers collaborating with developers could use this, because what it does
    is fairly simple: it exports the coordinates of selected items in a document.
    Designers can mind they're own workflow and simply send a bit of code so developers
    cand use the assets, place them at the correct location and make them interactive.
    The coordinates can be copied to clipboard or saved to disk, either in actionscript 3.0
    or XML format. The XML format can be used with a variety of languages(HTML5, Objective-C, Java, etc.)
    Instructions and more details can be found in this blog post.
    I'm not sure if this is best place for a script release announcement, so
    if I'm posting this in the wrong place, do let me know.

    Glad it helps.
    Thank you very much for the notice. Unfortunately I couldn't find an elegant solution to the Extension Manager locale problem I have.
    Following your suggestion, I've updated the blog post and links to both the packaged and unpackaged version of the script, with a small print
    explaining the difference.

  • Selection coordinates output

    Good day to all,
    First of all, I am so new in programming.
    I just learn about a week (Java Language).
    I already have a code that shows the coordinates of selected area.
    But the output in the text file is x,y,x,y,x,y...
    I want the output to be x,x,x... and y,y,y... in new line.
    Example:
    In the code, the output is:
    578,337,529,488,512,526,478,512,486,464,484,464,480,475,477,475,479,458,477,458,472,462,47 2,458,476,442,484,420,519,363,528,355,554,334
    What I want is:
    578,529,512,489,478,486,484,480,477,479,477,472,472,476,484,519,528,554
    337,488,526,517,512,464,464,475,475,458,458,462,458,442,420,363,355,334
    I mean the x coordinates are on first line and y are on the second line.
    Here is my code:
    #target Photoshop
    var data=mapa_seleccion(activeDocument,data)
    function mapa_seleccion(doc,out){
          var hs = doc.historyStates;
          preferences.rulerUnits = Units.PIXELS;
          doc.selection.makeWorkPath(1);
          var p = doc.pathItems["Work Path"];
          var a = new Array();
          var t = 0;
          var l = p.subPathItems.length;
          for ( k = 0; k < l; k++) {
               var n = p.subPathItems[k].pathPoints.length;
               a[k] = new Array (n);
               for ( i = 0; i < n; i++){
                    a[k][i] = new Array();
                    a[k][i]=p.subPathItems[k].pathPoints[i].anchor;
          var t = 0;
          for ( k = 0; k < l; k++) {
               var n = a[k].length;
               var s = 0;
               for ( i = 0; i < n; i++){
                    var j = (i+1)%n;
                    s+=(a[k][i][0]*a[k][j][1]);
                    s-=(a[k][i][1]*a[k][j][0]);
               s/=2;
               t+=s;
          doc.activeHistoryState = hs[hs.length-2];
          out=new Array()
          out.mapa=a
          out.area=parseFloat(t/doc.resolution/doc.resolution*2.54*2.54).toFixed(2) //conv ierte a cm2
          return out
    alert(data.mapa[0]);
    //data.mapa[0];
    if ($.os.search(/windows/i) != -1)
        fileLineFeed = "windows";
    else
        fileLineFeed = "macintosh";
    var fileName = app.activeDocument.name
    var fileOut = new File('~/Desktop/coords.txt');
    fileOut.linefeed = fileLineFeed;
    fileOut.open("w", "TEXT", "");
    fileOut.writeln(data.mapa[0]);
    fileOut.close();
    Thanks to muyshangai for the codes.
    And thank you guys in advance

    var data=mapa_seleccion(activeDocument,data);
    function mapa_seleccion(doc,out){
      var hs = doc.historyStates;
      preferences.rulerUnits = Units.PIXELS;
      doc.selection.makeWorkPath(1);
      var p = doc.pathItems["Work Path"];
      var a = new Array();
      var t = 0;
      var l = p.subPathItems.length;
      for ( k = 0; k < l; k++) {
           var n = p.subPathItems[k].pathPoints.length;
           a[k] = new Array (n);
           for ( i = 0; i < n; i++){
                a[k][i] = new Array();
                a[k][i]=p.subPathItems[k].pathPoints[i].anchor;
      var t = 0;
      for ( k = 0; k < l; k++) {
           var n = a[k].length;
           var s = 0;
           for ( i = 0; i < n; i++){
                var j = (i+1)%n;
                s+=(a[k][i][0]*a[k][j][1]);
                s-=(a[k][i][1]*a[k][j][0]);
           s/=2;
           t+=s;
      doc.activeHistoryState = hs[hs.length-2];
      out=new Array()
      out.mapa=a
      out.area=parseFloat(t/doc.resolution/doc.resolution*2.54*2.54).toFixed(2) //conv ierte a cm2
      return out
    // data,mapa is an array of nested arrays
    alert(data.mapa.toSource());
    // here is how to 'split' the x,y array of the first subPath
    var xArray = [];
    var yArray = [];
    for(var i=0;i<data.mapa[0].length;i++){
        xArray.push(data.mapa[0][i][0]);
        yArray.push(data.mapa[0][i][1]);
    //data.mapa[0];
    if ($.os.search(/windows/i) != -1){
        fileLineFeed = "windows";
    }else{
        fileLineFeed = "macintosh";
    var fileName = app.activeDocument.name
    var fileOut = new File('~/Desktop/coords.txt');
    fileOut.linefeed = fileLineFeed;
    fileOut.open("w", "TEXT", "");
    //fileOut.writeln(data.mapa[0]);
    fileOut.writeln(xArray);
    fileOut.writeln(yArray);
    fileOut.close();

  • After Validation. How to find the coordinates of a bad edge?

    Hello. we're using oracle 9i and trying to decipher some validation problems.
    Given a validation error such as
    13349 [Element <2>] [Ring <1>][Edge <298>][Edge <302>]
    How do I get the long/lat coordinates that made edge 298 and 302.
    If this had been element one i'm sure it would have been the 298th 299th pair of coordinates and such, but i dont even know how to construct a query which will return that
    How do I turn
    select coordinate[298] from My_map
    into an actual syntax.
    and if there is something even better for retrieveing
    select elem[2].coordinate[298] from my_map
    Any help would be greatly appreciated.
    -kevin

    Kevin,
    SDO_UTIL.EXTRACT should do the trick - http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96630/sdo_util.htm#sthref1628.
    This function returns the geometry that represents a specified element (and optionally a ring) of the input geometry.
    Hope this helps.
    -Justin

  • Please see my code and helpme out pls

    //Making Circle here
    gridx=20;
    gridy=20;
    num=0;
    for (var i=0;i < 10;i++)
    for (var j=0;j < 10;j++)
    dot.duplicateMovieClip("dot"+num,num);
    mc=this["dot"+num];
    mc._x=gridx*i;
    mc._y=gridy*j;
    num++;
    dot._visible=0;
    // here i make plain circle, but problam is my all circle
    open in fornt side, i want to that all my circle in background
    //hide all selection MovieClip
    for(i=1; i<=100; i++){
    this.createEmptyMovieClip("test_mc"+i,
    this.getNextHighestDepth());
    this["test"+i]._visible = false;
    // here i make fill circle mc, all hide with this code, but
    problam is all circle come in background
    //selection area
    _root.onMouseDown = function() {
    sel = this.createEmptyMovieClip("sel", 1);
    sel.startx = _xmouse; // we need to reference these later,
    so add them as properties of the selection clip
    sel.starty = _ymouse;
    this.onEnterFrame = function() {
    with(sel){
    clear();
    lineStyle( 1, 000000, 100 );
    moveTo(sel.startx, sel.starty);
    lineTo(_xmouse, starty);
    lineTo(_xmouse, _ymouse);
    lineTo(sel.startx, _ymouse);
    lineTo(sel.startx, sel.starty);
    _root.onMouseUp = function() {
    _root.select(sel.startx,sel.starty,sel._xmouse,sel._ymouse);
    // call the selection function
    removeMovieClip(sel);
    this.onEnterFrame = undefined;
    _root.select =
    function(x1:Number,y1:Number,x2:Number,y2:Number){
    // in case you dragged the selection box from right to left
    or bottom to top, we need
    // to work out the top left and bottom right coordinates..
    var sx = Math.min(x1,x2);
    var ex = Math.max(x1,x2);
    var sy = Math.min(y1,y2);
    var ey = Math.max(y1,y2);
    for(var item in this){ // loop through all items in the
    _root
    if(typeof(this[item])=="movieclip"){ // if the current item
    is a movieclip..
    this[item]._visible = isInside(this[item],sx,sy,ex,ey);
    function
    isInside(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):Boolean{
    // check whether the selection coordinates enclose the mc
    coordinates
    return (x1<=mc._x && x2>=mc._x+mc._width
    && y1<=mc._y && y2>=mc._y+mc._height);
    // here u can find selection option, selection option is
    wroking, but same problam, it work in background, & hide my all
    MC (that Plain Circle also) and highlight only which we select
    // Some brif here:
    i want to create plain circle in background, after that some
    one want to slecte that palin circle highlight that circle only
    with fill circle ( for better explaination see my fla file which is
    attach here
    Please see this
    Pls pls help me out
    thanks
    praful damania

    for better explaination pls see my fla file which is attache
    there & I have some quation about it as under
    1) here i make fill circle mc, all hide with this code, but
    problam is all circle come in background
    2) here i make fill circle mc, all hide with this code, but
    problam is all circle come in background
    3) here u can find selection option, selection option is
    wroking, but same problam, it work in background, & hide my all
    MC (that Plain Circle also) and highlight only which we select
    i want to create plain circle in background, after that some
    one want to slecte that palin circle highlight that circle only
    with fill circle
    thanks for reply
    Praful Damania

  • Create the stock in storage bin level

    Hai all
         while i am doing transfer of order it is asking that storage unit type and the material stock is not maintained in storage bin .
    can anybody tell me how to maintain the stock in bin level .please help me is there any tcode for that
    regards
    satish

    Dear Satish
    A storage type generally contains several storage spaces or slots. These are called storage bins in Warehouse Management (WM). The storage bin is the smallest available unit of space in a warehouse. The storage bin therefore describes the position in the warehouse where the goods are or can be stored.
    Since the address of a storage bin is frequently derived from a coordinate system, a storage bin is often referred to as a coordinate. The coordinate 01-02-03 for example, can refer to a storage bin in row 1, stack 2, and level 3.
    You assign each storage bin to a specific warehouse number and storage type according to its location. You must also assign each storage bin to a storage section.
    You can also define the following additional characteristics of a storage bin:
             --> Maximum weight
             --> Total capacity
             --> Fire containment section
             --> Storage bin type (for example, for small or large pallets)
    With certain stock placement strategies, the storage bin type plays a significant role in optimizing the automatic search for a storage bin in connection with the pallet type. For example, you can define the WM putaway strategy to place large industrial pallets into a specific large bin type and smaller pallets into small bins.
    <i><b>For information on how to define storage bins, call up the Implementation Guide (IMG) for Warehouse Management and see under Master Data --> Storage Bins .</b></i>
    Generally speaking, you can use any combination of letters and numbers for a storage bin coordinate with the exception of certain alphanumeric characters that are used for stock placement strategy P (according to pallet or storage unit type).
    When goods are placed into storage, the system selects coordinates in ascending order according to specific sort criteria, and assigns the next available storage bin based on the coordinate structure you define for creating bins.
    Thanks
    G. Lakshmipathi

  • X Axis label of Column Chart

    Hello,
    I am Plotting column chart based on the data present in datagridview;Column 1(having string Data Type) as my X axis value and Column Y as my Y axis value.On Column chart click event i am fetching x axis and y axis co-ordinates of my column chart and displaying
    in Label on my form.But when i click it shows "0" as my x axis cordinate for the clicked column.
    As my x axis is having labels as 06:00:00-07:00:00,07:00:00-08:00:00,..........
    Below is image of my application
    f Chart1.Series(0).Name = "Daily Data" Then
    'Chart1.Series(0).XValueType = ChartValueType.Time
    Chart1.Series(0).Points(result.PointIndex).XValue.ToString()
    'xval = xval.AddHours(Chart1.Series(0).Points(result.PointIndex).XValue)
    Label4.Text = "Selected Coordinates are: " & Chart1.Series(0).Points(result.PointIndex).XValue.ToString & ", " & Chart1.Series(0).Points(result.PointIndex).YValues(0).ToString("f2")
    End If
    Else
    If result.ChartElementType <> ChartElementType.Nothing Then
    Dim elementType As String = result.ChartElementType.ToString()
    Label4.Text = "Selected Element is: " & elementType
    End If
    End If

    You need to get this example from Microsoft. It is a c# project code you just run it in Visual Studio. It shows most everything you can do with a chart. It shows the vb code when you run it and click the vb tab. Near the bottom of the left tree is Appearance
    - Labels etc. Also under data types there are date and time examples. This link is also in the forum faqs at the top of the chart forum posts.
    Chart examples.
    I think you need to tell the chart to use datetime for the labels but I am not sure how and I am not too good with them but that is why I do this to learn things. I would just look in the chart examples from the link I show. That is how I answer most of
    the questions here.
    Can you reproduce your problem using the simple example from the other question? Otherwise I cant really do much.
    Also, most times when you make a simple example you will find the problem or at least understand it better.
    So take a look and come back if you cant get it I then I will try too.

  • Performance problem on view with spatial column - resolved

    I have had a problem with queries on a view that had a spatial column, where the view did not belong to the logged in user. Where my spatial window was retrieved by a sub-query, the spatial scan did a full table scan instead of using the spatial index.
    I have found that the problem can be resolved by granting MERGE VIEW on the view to the querying user.
    The view can be as simple as SELECT * FROM table.
    The badly performing query could be as simple as
    select id from T1.tstview
    where SDO_RELATE(coordinates,
    (SELECT coordinates FROM T1.tstWINDOW WHERE ID = '1')
    ,'mask=INSIDE+COVEREDBY querytype=WINDOW') = 'TRUE'  ;
    I think this is a bug, and have raised an SR - MERGE VIEW is supposed to override issues with the "security intent" of a view.
    The workaround is simple enough once you're aware of it and I thought it was worth passing on.

    Thanks for sharing this workaround!
    Which ORACLE version did you test ?

  • Plugin with similar functionality to snapshot tool

    I would like to develop a plugin with functionality similar to the Acrobat snapshot tool. I'd like to provide a method for the user to select a rectangular region, and capture an image of that region to the clipboard, which is exactly what the snapshot tool does (I also want to add some features not provided by the snapshot tool once this is working). I've reviewed the SDK samples, and I'm not sure how to get started. Is this a special case of a Selection Server? Which API methods allow me to get the image of the rectangular selection, rather than iterating through PDF elements contained within?
    Thanks!

    Hi Leonard,
    Thanks for the quick reply! Let me break down the areas I'm still unclear on into a couple of questions:
    (1) What is the best way to allow the user to draw a rectangular selection? Are there some callback functions I should implement to allow the user to click and drag a marquee, or do I have to handle the code to draw the rectangle myself? I'm wondering, for example, if I need to implement the drawing code as part of a custom AVTool DoClickProcType callback, or if there is a better, built in way to get a rectangular area that a user has drawn (given that this operation is common to many tools).
    (2) Once I have the rectangular selection coordinates from #1 above, how do I render it to an offscreen bitmap as you suggested? Is there a function in the API that allows me to do this?
    Thanks again!
    Steve

  • Illustrator path to Presets/Scripts including locale

    Hi,
    I've made a little jsx Illustrator script I'd like to pack as an extension.
    Looked at MXI tech note Path Tokens appending and found the $presets token.
    Unfortunately it does NOT include the locale in it's path.
    For example, my path is /Applications/Adobe Creative Suite 5/Adobe Illustrator CS5/Presets.localized/en_GB/Scripts
    For other locales that will be different and the $presets toke doesn't help, it's the sames as $illustrator/Presets.localized as far as I can tell.
    How can can I set the path of my script to Illustrator's Scripts folder from my MXI ?

    Hello Carl,
    Thank you very much for taking your time for this.
    It looks promising, but unfortunately this doesn't fully work as expected.
    I've updated XManConfig.xml as advised and repackaged/installed my script
    but it gets written into en_US instead of en_GB.
    Not sure how the $LOCALE token works.
    The 'workaround' I have in place at the moment works, but it's pretty messy/hacky:
    I copy the script for EVERY locale illustrator has.
    Even with this, I'm not sure if all the possible install locales are the ones that are listed
    in the Illustrator Download page:
    <!-- Illustrator Install Locales -->
              <file source="Save Selection Coordinates.jsx" destination="$presets/cs_CZ/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/da_DK/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/nl_NL/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/en_GB/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/en_US/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/fr_FR/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/en_GB/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/de_DE/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/it_IT/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/ja_JP/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/ko_KR/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/pl_PL/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/ru_RU/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/es_ES/Scripts/" shared="true" />
              <file source="Save Selection Coordinates.jsx" destination="$presets/sv_SE/Scripts/" shared="true" />
    or the ones used in the legal notes:
    <!--All legal locales-->
    <file source="Save Selection Coordinates.jsx" destination="$presets/ar_AE/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/cs_CZ/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/da_DK/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/de_DE/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/el_GR/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/en_GB/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/en_US/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/es_ES/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/es_MX/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/fi_FI/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/fr_CA/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/fr_FR/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/he_IL/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/hu_HU/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/it_IT/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/ja_JP/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/ko_KR/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/nb_NO/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/nl_NL/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/pl_PL/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/pt_BR/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/ro_RO/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/ru_RU/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/sv_SE/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/tr_TR/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/uk_UA/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/zh_CN/Scripts/" shared="true" />
    <file source="Save Selection Coordinates.jsx" destination="$presets/zh_TW/Scripts/" shared="true" />
    I really hope you're solution can be tweaked to work as it would be cleaner to update XManConfig.xml along with the script than making loads of unneccesary copies.
    Regarding the next release, yes, the localized presets token would be very helpful.

  • Set string to clipboard

    Hi,
    Photoshop JSX noob here.
    I want to do a very basic thing: copy a selection rectangle as text.
    Ideally if I can get the location of the mouse and copy it to the clipboard, that would be great,
    but bounds is ok as well.
    I've managed to output selection coordinates:
    $.writeln(app.activeDocument.selection.bounds);
    how can I get those coordinates copied into the system clipboard ?
    note: I am using osx 10.5.8.

    Christof, this is related to another post 'Brush Opacity on the mac' but as you have CS4 would you be kind enough to test this…
    #target photoshop
    // Must be Foremost to accept the key commands
    app.bringToFront();
    // If you have the brush tool selected
    // This should keystroke 'enter'
    var sh = app.system("osascript -e 'tell application \"System Events\" to keystroke (ASCII character 3)'");
    sh ? alert('Failed?') : alert('Done…');
    // This should keystroke string value '36'
    var sh = app.system("osascript -e 'tell application \"System Events\" to keystroke \"36\"'");
    sh ? alert('Failed?') : alert('Done…');
    // This should keystroke 'tab'
    var sh = app.system("osascript -e 'tell application \"System Events\" to keystroke tab'");
    sh ? alert('Failed?') : alert('Done…');
    // This should keystroke string value '64'
    var sh = app.system("osascript -e 'tell application \"System Events\" to keystroke \"64\"'");
    sh ? alert('Failed?') : alert('Done…');
    // This should keystroke 'enter' again
    var sh = app.system("osascript -e 'tell application \"System Events\" to keystroke (ASCII character 3)'");
    sh ? alert('Failed?') : alert('Done…');
    You can comment out the dialog stuff. This all works as AppleScript without issue but someone wanted to know if there was a mac workaround with JavaScript…

  • Portable - small api with similar functionality to httpclient?

    Title pretty much says it all, I have worked with httpclient for a while and now I need to find a portable replacement which should be ideally less than 50k. Any clues there? No need for https no need for authentication protocols, plain http. Else I'll just go an implement it myself.
    Regards.

    Hi Leonard,
    Thanks for the quick reply! Let me break down the areas I'm still unclear on into a couple of questions:
    (1) What is the best way to allow the user to draw a rectangular selection? Are there some callback functions I should implement to allow the user to click and drag a marquee, or do I have to handle the code to draw the rectangle myself? I'm wondering, for example, if I need to implement the drawing code as part of a custom AVTool DoClickProcType callback, or if there is a better, built in way to get a rectangular area that a user has drawn (given that this operation is common to many tools).
    (2) Once I have the rectangular selection coordinates from #1 above, how do I render it to an offscreen bitmap as you suggested? Is there a function in the API that allows me to do this?
    Thanks again!
    Steve

  • PhotoShop Automation PlugIn: How do I get the coordinates of a polygonal selection?

    Hi.
    I try to get the coordinates out of a selection, but I can't find out how to do that.
    I tried to convert the selection into a path and get the coordinates from the path. That doesn't work either.
    Can somebody give me a list of parameters inside the action descriptor of keyPathContent in classPath? I assume that the point infos are located there...
    Thanx in advance,
    Christian

    found the answer myself. It might be helpfull to others.
    btn.addMouseListener(new MouseAdapter(){
    public void mouseClicked(MouseEvent e) {
    Rectangle ret = btn.getBounds();
    double y = ret.y + ret.getHeight();
    pop.show((Component) e.getSource(), ret.x, (int)y);
    }

  • Is there a plugin that can copy the coordinates of a selection to the clipboard?

    Is there a plugin in existance, that I can make a selection in Photoshop and then copy the coordinates of that selection to the clipboard?
    I am a texture artist and frequently lay a number of graphics out in one file, before typing out the coordinates for each element. Currently this is a slow manual task, but could be made so much faster if I didn't have to type everything out.
    Thanks,
    Matt

    I have to admit to not fully understanding your work flow, but to the extent I do Here is what I suggest:
    I would open your image and create a new action and start recording. I would then create the rectangular selections in sequence and stop recording when you are done. Then I would save the action as a text file. The resulting text file for a test image, having created three different rectangular selections, looks like this:
    Action: Action 1
            Set Selection
                To: rectangle
                Top: 0.451 Inches
                Left: 0.917 Inches
                Bottom: 0.559 Inches
                Right: 1.017 Inches
            Set Selection
                To: rectangle
                Top: 0.767 Inches
                Left: 0.892 Inches
                Bottom: 0.868 Inches
                Right: 0.986 Inches
            Set Selection
                To: rectangle
                Top: 1.108 Inches
                Left: 0.885 Inches
                Bottom: 1.201 Inches
                Right: 0.986 Inches
    You can use this  for the rest of your process.
    To make things easier you should clear all actions before creating your new action or the text file will contain all of the active actions and you would have to hunt for the new action in the text file.
    Hope this helps.
    Paulo

Maybe you are looking for

  • Closed port for torrent with no iptables.rules

    I have a home system with internet connection over a router. Firewall in the router seems to be disabled. I had installed guarddog and selected all the protocols that I need. There is no iptables in deamons line of rc.conf nor there is any iptables.r

  • Smart Album Keyword Bug

    I have a library of 17,440 "Referenced" photos, grouped across multiple projects, none of which contain more than about 400 photos. Prior to importing these images into Aperture, I had already keyworded all of them; the keywords are embedded within t

  • Auto creation of PO from Sales Order

    Hi All, In third party process, i want a PO while saving the Sales Order. In Genearll practice a PR gets generated while saving the sales Order. Here in this case i want a PO must be created in background while saving the Sales Order. Its very Urgent

  • JAVA Sax mapping replaces &_amp; with & causing mapping to fail

    Hi all, I have the following mapping scenario: Source XML -> Java Sax Mapping -> Graphical Mapping -> Target structure The source XML is valid and caters for special characters like & which appear as &_amp; in the XML (ignore the underscore _ without

  • Utf-8 filename characters in Motif applications

    Hello, 1) my Xpdf/Xdvi apps work quite well, but unable to save files with non-latin characters in filenames. 2) in addition Xpdf fails to search non-latin characters/words in pdf files. Unfortunately I can't google appropriate way to solve this. Any