Select a layer whose name is the same as another layer

I have two layers with the same name. How can I select the one I want from an automation plugin?
thanks
Bill

I wonder if this may help.
The top left of the bounding box will be the layer bounds [0] (left) and [1] (top)
#target photoshop
app.documents.add();
var FontName = "Arial";
var FontSize = 14;
var black = new SolidColor();
black.rgb.hexValue = '000000';
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var newTextLayer = activeDocument.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.kind = TextType.POINTTEXT
newTextLayer.textItem.color = black;
newTextLayer.textItem.font = FontName;
newTextLayer.textItem.size = FontSize;
newTextLayer.textItem.contents = "The quick brown fox jumps over the lazy dogs back 1234567890";
newTextLayer.textItem.kind = TextType.PARAGRAPHTEXT;
newTextLayer.textItem.height =300;
newTextLayer.textItem.width = 100;
newTextLayer.textItem.position = Array(10, 10);
newTextLayer.textItem.justification=Justification.CENTERJUSTIFIED;
var LB = newTextLayer.bounds;
var doc = activeDocument;
alert("Bnds height = " + (LB[3]-LB[1]) + " Bnds Width = " + (LB[2]-LB[0]));
alert("BB Height = " + doc.activeLayer.textItem.height + " BB Width = " + doc.activeLayer.textItem.width);
app.preferences.rulerUnits = startRulerUnits;

Similar Messages

  • Selection of Folder/File name using the same Fun.Module

    Please let me know if there is a function module which can fetch folder name/File name  from the directory path when f4 option of selection screen field is selected. Currently I am able to get the file name using FM F4_DXFILENAME_4_DYNP but the requirment is like I have to select either folder name or the file name depending on user selection.
    Note: Please let me know if there is a single Function module which can get folder name or the file name based on the user selection.i.e, if the user want to select a folder he can select or he can select files in the folder for processing

    Hi sridhar
    try this:
    PARAMETER : TXT_FILE(100).
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR TXT_FILE.
    PERFORM GETFILE.
    start-of-selection.
    PERFORM GETDATA.
    FORM GETDATA.
      DATA : FILENAME TYPE STRING.
      FILENAME = TXT_FILE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = FILENAME
         FILETYPE                       =  'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          DATA_TAB                      = IT_UPLOAD
      EXCEPTIONS
        FILE_OPEN_ERROR               = 1
        FILE_READ_ERROR               = 2
        NO_BATCH                      = 3
        GUI_REFUSE_FILETRANSFER       = 4
        INVALID_TYPE                  = 5
        NO_AUTHORITY                  = 6
        UNKNOWN_ERROR                 = 7
        BAD_DATA_FORMAT               = 8
        HEADER_NOT_ALLOWED            = 9
        SEPARATOR_NOT_ALLOWED         = 10
        HEADER_TOO_LONG               = 11
        UNKNOWN_DP_ERROR              = 12
        ACCESS_DENIED                 = 13
        DP_OUT_OF_MEMORY              = 14
        DISK_FULL                     = 15
        DP_TIMEOUT                    = 16
        OTHERS                        = 17
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.
    FORM GETFILE.
      CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
        DEF_FILENAME           = ' '
         DEF_PATH               = '.'
        MASK                   = ' '
        MODE                   = ' '
        TITLE                  = ' '
       IMPORTING
         FILENAME               = TXT_FILE
        RC                     =
      EXCEPTIONS
        INV_WINSYS             = 1
        NO_BATCH               = 2
        SELECTION_CANCEL       = 3
        SELECTION_ERROR        = 4
        OTHERS                 = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.
    <b>This is a part of my BDC program its working for me u try n reply if it works for u.</b>
    regards
    vijay

  • If variable name is the same as the column name in procedure ?

    If variable name is the same as the column name in procedure , What should i do?
    For Example :
    CREATE OR REPLACE PROCEDURE "TEST_PROC" (MIN_SALARY in UMBER)
    as
    begin
    INSERT INTO TEST SELECT JOB_ID,MIN_SALARY FROM JOBS WHERE MIN_SALARY = MIN_SALARY;
    end;

    You could follow a better naming convention and have the parameters to the procedures named in a way so as not to be confused with column names.
    You could prefix the variable names with the name of the procedure they appear in but then what if your have procedure names same as table names?
    SQL> create or replace procedure test_proc(sal in number) is
      2    cnt number ;
      3  begin
      4    select count(*) into cnt from scott.emp where scott.emp.sal = test_proc.sal ;
      5    dbms_output.put_line('cnt='||cnt) ;
      6  end ;
      7  /
    Procedure created.
    SQL> set serveroutput on
    SQL> exec test_proc(800) ;
    cnt=1
    PL/SQL procedure successfully completed.
    SQL>If you search you can find several posts here itself on naming convention to avoid such issues in first place.

  • Unable to copy database with different name in the same instance

    I had a huge database and wanted to try some change optimization changes.
    So wanted to make a copy of the database along with data in the same instance.
    I have tried copy database wizard several times but always see the error as in attachment.
    Can someone let me know how to troubleshoot further?
    If this is not the correct way please suggest how do i copy a database with different name in the same instance along with data.

    Hi Nandu,
    From the screenshot, the error 1813 happens when corrupt database log is attempted to attach to the SQL Server. To work around this issue, please preform the following steps, for more details, please review this
    blog.
    1. Create a new database with same name which you want to recover. Make sure that the MDF file and LDF file have same name with previous database data and log file.
    2. Stop SQL Server. Move original MDF file from old location to new location by replacing just created MDF file. Delete the LDF file of new location just created.
    3. Start SQL Server. At this point, the database is in suspect status.
    4. Make sure that system tables of Master database allows to update the values. Please note that you will be performing this in query window.
    Use Master
    go
    sp_configure 'allow updates',1
    reconfigure with override
    go
    5. Change database mode to emergency mode.
    SELECT *
    FROM sysdatabases
    WHERE name = 'DatabaseName'
    BEGIN
    UPDATE sysdatabases
    SET status = 32768
    WHERE name = ' DatabaseName '
    COMMIT TRAN
    6. Restart SQL Server. Then execute the following DBCC command in query window to create new log file.
    DBCC TRACEON (3604)
    DBCC REBUILD_LOG(databasename,'c:\yourdatabasename_log.ldf')
    GO
    7. Reset the database status using following command.
    sp_RESETSTATUS yourdatabasename
    GO
    8. Turn off the update to system tables of Master database running following script.
    USE MASTER
    GO
    sp_CONFIGURE 'allow updates',0
    RECONFIGURE WITH OVERRIDE
    GO
    9. Reset the database status to previous status.
    BEGIN
    UPDATE sysdatabases
    SET status = (value retrieved in first query of step 5)
    WHERE name = 'DatabaseName‘
    COMMIT TRAN
    GO
    Make sure that you have done all the steps in order and restarted SQL Server where it is mentioned. Also run SQL Server Management Studio as administrator.(Right click-> Run as Administrator)
    Thanks,
    Lydia Zhang

  • There was an error while writing data back to the server: Failed to commit objects to server : Duplicate object name in the same folder.

    Post Author: dmface15
    CA Forum: Administration
    I am working in a new enviorment and i am trying to save a report to the Crystal Server via the CMC. I am uploading the report from the objects tab and attempting to save to a folder. The report has 1 static defined parameter and that's it. When i click submit to save the report i receive the following error message: "There was an error while writing data back to the server: Failed to commit objects to server : Duplicate object name in the same folder." There is not a anothe report within the folder with that name. What could be causing this error message and equally important, what is the solution.

    hte message you received about duplicate user probably means something hadn't fully updated yet. Once it did then it worked...
    Regards,
    Tim

  • After installing iOS6, my Maps are not working at all, anything i search it says "result not found" even after placing a pin and selecting "Direction to here" i get the same result not found. Very disappointed with the new iOS

    After installing iOS6, my Maps are not working at all, anything i search it says "result not found" even after placing a pin and selecting "Direction to here" i get the same result not found. Very disappointed with the new iOS.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • Creating a variable whose name is the value of a String

    Hi guys
    i want to create java variables dynamically whose name is the
    value of String .
    Such as
    String str="object";
    now i want to ceate a variable of
    type int whose name will be "object".
    in what manner i can do this.

    i want to create java variables dynamically whose
    name is the
    value of String .
    Such as
    String str="object";
    now i want to ceate a variable of
    type int whose name will be "object".
    in what manner i can do this.
    You can't. The best you can do is create a Java source file and compile it on the fly.
    Could you tell us why you want to do this? I have no doubt at all that you are working with a bad design, and maybe we could help you fix it.

  • Relinking where the filename has changed but tape name is the same, can it be done?

    Should it be possible to relink to media based on matching tape name?
    So i have X files in a folder, each has a unique tape name. Then some of those files are regenerated with different filenames but the tape name remains the same. I was naively assuming that the relocate dialogue, if you had tape name checked and nothing else would then match the files name for name and find them automatically.
    That doesn't seem to be the case.
    So am i wrong? Or is there a way of relinking several hundred files where the filename may change - how can i get premiere to relink to a file other than exact filename match?
    thanks
    Paul

    Hi Fuzzy!
    I did look at that but it's a large extra step that wouldn't be ideal. The idea is that i need a timeline just changing as files are updated in the background, i don't want to have an extra workflow step in there. I can probably arrange it so the filenames don't change (not ideal) but the key is that the linking dialogue appears to suggest that i should be able to relink using tape name but it just doesn't appear to work.
    If i relink one of the files then i'd expect PPro to go off any find any other missing ones based on the tape name, but nope...
    thanks anyway
    cheers
    Paul

  • LabVIEW 2010 App Builder: Registry editor has issue with keys of the same name at the same level in registry tree

    This is a bug report for an NI application engineer.  Please file a CAR. 
    In a LabVIEW 2010 project, create a new installer build and go to the Registry editor.
    Enter some keys like the following
    Click OK to close the installer wizard.
    Now reopen the build specification and go to the Registry editor.  The registry editor comes up blank and non functional.
    I believe the registry entries are still written when the installer executes, but you cannot edit the registry any further in LabVIEW 2010.  This was not an issue in LV 2009. The issue seems to stem from having two keys with the same name at the same level in the registry tree (in this case, the two "Test" keys). 

    Hi sensor_daniel,
    This was reported to R&D (#305026) for further investigation.
    Thanks for the feedback! 
    Have a great day,
    Chris V
    Applications Engineer
    National Instruments

  • Dispatch center - Select multiple tasks for scheduling at the same time

    Hi!
    I need a consultation regarding Dispatch center. Is there a functionality to select multiple tasks for scheduling at the same time for one resource?
    Please, guys, this is urgent.
    Jan

    You can schedule a single task or multiple tasks automatically directly from the
    dispatch center. The scheduling criteria applied come from Advanced Scheduler.
    Make Sure, you have the advanced scheduler. With out Advanced Scheduler and by just using Advice, you can only assign one task at a time.
    HTH
    ps: for more information, refer Field Service User Guide, "Scheduling Tasks"

  • How to put two files with the same name into the same folder?

    How can I put two files with the same name and the same extention into the same directory?
    Is this even possible?
    Thanks in advance. 

    Are you sure? I would be very surprised if that was the case.
    How does the computer/filing system differentiate the files, if not by their names?
    How do you tell the computer which one you want? (On the command line.)

  • CSCul66951 LDAP routing query fails when user name is the same (6 july 2014)

    in the case CSCul66951 LDAP routing query fails when user name is the same it is mentionned that the version 8.0.2-055 correct this bug ? How come i don't see this version on my menu Available upgrades from my IronPort C370 ?
    Is there someone on the support team that have try this LDAP query on a IronPort C370 with this version in the development lab ?
    Do i have to open a support Case to have this version of AsyncOS ?
    Best regards,
    Benoit Belair
    University of Quebec in Montreal

    Yes - CSCul66951 - this was included w/ the 8.0.1-HP1, and is rolled into 8.5.6-074 GA release.
    See release notes, resolved issues:
    http://www.cisco.com/c/dam/en/us/td/docs/security/esa/esa8-0/release_notes/ESA_8-0-1_HP1_Release_Notes.pdf
    CSCun02766 - 8.5.6-063, which was superseded by the 8.5.6-074 GA release.  
    See release notes, resolved issues:
    http://www.cisco.com/c/dam/en/us/td/docs/security/esa/esa8-5-6/ESA_8-5-6_Release_Notes.pdf

  • Dng and tif file with the same name, in the same Lightroom folder

    If I have both a dng and tif file with the same name, in the same Lightroom folder, I can only see and access one of them. Is there a setting I can change in order to see both of them?

    If you can only see one of them, which one can you see?
    Was the DNG and the TIF imported at the same time?
    How are you trying to "access" the files?
    The more details you can provide, the more likely it is that someone will be able to help you.

  • HT204074 Our new iphone5 id name is the same as an existing still in use iphone4 in the family; if I remove the devise; change its name can I then immediately associate it with the correct name.

    I have read the HT4627 but I think my original question is more specific  Our new iphone5 id name is the same as an existing still in use iphone4 in the family; if I remove the devise; change its name can I then immediately associate it with the correct name.

    You can change the name of a device on it via Settings > General > About > Name - you shouldn't need to remove the association and then reassociate it.

  • I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image,

    I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image, the guidelines are not locked, it is annoying to have to lock them down again. and it would actually be nice, to ba able to give specific directions when placing the guidelines. Thanks

    Then why are the guides unlocked when I reopen a document that I saved with the guides locked ?
    Thanks.

Maybe you are looking for

  • HT4061 I am locked out of my Ipad it wants my passcode that I do not have?

    Iam locked out of my Ipad. It wants a passcode that I do not have. I have tried the re-boot and that did not work. This is a hand me down ipad and it was working for about a month then today it wanted this passcode? Don't know what to do I have a pc

  • Photoshop CC crashes when I try to print

    I have photoshop CC and everytime I try to print it crashes.. Help?!

  • Barcode printing using dot matrix printer

    Hi, Can anyone let me know what all DOT Matrix printers support barcode printing (PDF 147 type), The barcode is printed in invoice when printout is taken using laser jet but when using dot matrix (Panasonic kx-p3696), the invoice gets printed  withou

  • Photo Card Reader & iPad Mini

    Can I use the Apple iPad Camera Connection Kit to connect a Card Reader (compatible with 4 different cards for my different cameras) to my iPad Mini? I note the product description describes connecting my camera with a USB cable; would the card reade

  • 64 bit real - 32 bit or bitstream

    hav a look at the vi ..can someone help me to convert the 64-bit real output to 32-bit ot to bitstream.... Regards Attachments: 64.vi ‏18 KB