JS CS4: Create variable for current layer then select the layer at the end of a script

I'm coming up blank with the verbiage and spinning my wheels with the OMV and script guide.
var myOriginalLayer = app.activeDocument.layers.item(0);
alert(myOriginalLayer)
returns "object layer" and not the layer's name.
var myOriginalLayer = app.activeDocument.layers.lastItem().name;
Does return the layer name I want but not by selection.
I'm challenged on how to select the layer.

Hi John,
The difference lies in that the [Object Layer] is the actual object, and the 'name' is just a property -- just like its color.
You can use one of these two approaches:
var myOriginalLayer = app.activeDocument.layers.item(0);
alert(myOriginalLayer.name);
will hold the original layer object, and you can see the name if required :-)
To re-select the layer, use
app.activeDocument.activeLayer = myOriginalLayer;
Alternatively, selecting by name goes like
var myOriginalLayerNAME = app.activeDocument.layers.lastItem().name;
app.activeDocument.activeLayer = app.activeDocument.layers.item(myOriginalLayerNAME);
I also noticed the following:
app.activeDocument.layers.item(0) points to the first layer of your document; not the 'active' one. Similarly, app.activeDocument.layers.lastItem() just points to the very last one. I'm not sure if the order of the activeDocument.layers array mimicks the order as shown in the Labels palette, but I would hope it does :-)
To get/set the active layer, use app.activeDocument.activeLayer as shown above.

Similar Messages

  • Creating variable for attribute

    Hi guys,
    Is it possible to create variable for an attribute. My requirement is that the user wants Serial # as one of the user selection criteria which is an attribute of system code equipment in Dimension material. If not, is there any other possible way to get it in user selection criteria when the report is run.
    Thanks in advance.

    you cant create a variable on attribute of a char.
    other work around is to make Serial # a navigational attribute both in the IO (system code equipment) and in the cube maintenance too. That way in the report the attribute will be available as any other char in the cube.

  • How we create Variable for Previous year for COPA reports

    Hi Guruss,
    I am making a COPA report for Current year comparison with previous year from KE31. For 1st column I have created the Variable for current year (which works perfectly) now in 2nd column i need the actual data pertaining to previous. So can any one please guide me how to create the variable for previous year.
    Thanks

    Thanks Jagannadha,
    I have create the variable for current year on KE3E. but i am confuse how i create the variable for previous year on KE3E.
    Waiting for reply.

  • How to create variables for offsets?

    Hi BW Experts.
    I have a tricky one that has been posted before, but I couldn't get my head around a feasible answer just yet.
    My customer wants to be able to display his ageing AR report with different buckets, depending on the month.
    For example, if it's January he wants to see buckets for 1-30 days, 31-60 days, 61-90 days and 91 to 120 days.
    If it's February, he wants to see buckets for 1-28 days, 29-58 days, 59-88 days and 89-118 days.
    If it's March, he wants to see buckets for 1-30 days, 31-58 days, 59-88 days and 89-118 days,
    and so on.
    We have create a structure in the query, filtering the key figure 0DEB_CRE_LC by 0NETDUEDATE. We have a variable for 0NETDUEDATE as a starting date and use different offsets to get the buckets. However, the offsets need to be hard coded, preventing us the flexibility of choosing the days in the buckets.
    Is it possible to create variables for the offsets, so the user can choose the days for the buckets at the report run time?
    Thanks in advance.
    Kind regards,
    Aline Passos.

    Hi Aline,
    as user is entering 0NETDUEDATE & he needs different buket for different months, which are more or less decided well in advance, I believe it cane be handled by User Exit varaibles which will draw value from the variable value you have entered & go backward.
    you will need to write the ABAP code with your logic to drive the correct user exit values.
    hope it helps
    regards
    VC

  • How to create Variables for the Key Figures

    Hi All,
    How to create Variables for the Key Figures
    Thanks
    Bhaskar

    Hi,
    It is not possible to create the variables on Key figures directly. But we can create a formula variable with processing type 'User Entry' ,SO that the user entered value can be used in the calculations of the query.
    With rgds,
    Anil Kumar Sharma .P

  • I opened Adobe Acrobate XI Standard to create a form.  I then selected From Template, which took me to Adobe FormsCentral Online.  However, I think the form is an HTML web form.  All I wanted was a regular PDF form that I could email my co-workers for an

    I opened Adobe Acrobate XI Standard to create a form.  I then selected From Template, which took me to Adobe FormsCentral Online.  However, I think the form is an HTML web form.  All I wanted was a regular PDF form that I could email my co-workers for an internal project we're colletively working on.  Now I see that FormsCentral is going away and I can't get my doc to save as a PDF without an upgrade?  Help

    You should be able to log into the online Formscentral Acrobat XI air app and see your doc there. From there you would need to save it out as a PDF without a submit button to have it continue to work past July. If you don't see your online form(s) please let me know the adobeID you use to log into the service as well as the form name that is missing and I will look into it for you.
    Andrew

  • When I go to FaceTime I put in my Apple ID and then sign in, it signs in so I then tap next but it says its Verifying for a bit then takes me back to the sign in, what do I do?

    When I go to FaceTime I put in my Apple ID and then sign in, it signs in so I then tap next but it says its Verifying for a bit then takes me back to the sign in, what do I do?

    I did what they said but it still had me sign in and took me to the Virfying. Still does not work

  • TS4118 Turn off icloud sync for calendars and then in itunes you have the option to sync and it will work.

    Turn off icloud sync for calendars and then in itunes you have the option to sync and it will work.

    So?

  • HT5642 Upgraded this morning. All worked fine for about 30min then "no service". Still the same problem and a reset of the device only fixes the problem for 15min. then we are back to no service?? When will apple fix this???

    Upgraded this morning. All worked fine for about 30min then "no service". Still the same problem and a reset of the device only fixes the problem for 15min. then we are back to no service?? When will apple fix this???

    Tried to reset network settings ...only fixes it for 15min. Did a firmware restore and a clean new phone setup. no settings restore. still have network service after around 60min. still running 6.1. i do get a prompt that i have to update settings to LTE. Have not excepted the settings as yet. Cellular data is still set to 3G....

  • How to create tcode for modulepool program with selection screen?

    hi,
       How to create tcode for modulepool program with selection screen?
    thanks,
    sagar

    Hi,
    We need to goto SE80.
    In our program we right click on object name and goto create
    -> transaction. Enter the module pool program and screen number and save and activate.
    Or by SE93 also we can create a transaction code for our program.
    Hope ths helps.
    plz reward if useful.
    thanks,
    dhanashri..
    Edited by: Dhanashri Pawar on Jul 22, 2008 8:29 AM

  • I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    If I go through the setup that you suggested, won't I screw up the existing software on my system?
    No. The iTunes installer will first uninstall the existing version of iTunes and then put in the new one. (That's actually also what happens when you use Apple Software Update to install a new version ... it just doesn't show the uninstall phase like the iTunes64Setup.exe or iTunesSetup.exe does.)

  • Text Variable for Current Cal Year

    Hi Experts,
    I am performing some Calculactions in the Columns (Key Figures) as Fourmula...
    How can i name the Column with the Current Cal Year...
    My requirment is to name the column as Column2009 (Current Year)....and in the next  year it should be
    Column2010
    Please advise me on Text Variable

    Hi Raghu,
    I followed the procedure you outlined
    1. click on the key figure selection, where your are restricting the key figure with the customer exit variable.
    2. Now you have "change selection" popup window.
    3. In the description you have your key figure name. remove the description and write YTD &text_var_name&
    4.keep you cursor on &text_var_name& and select &text_var_name& and then,
    Beside "description" you will be able to see a variable ikon. click on that, from the contex menu of the variable ikon, choose the "change variable" option.
    5.you will now see a 'change variable'' popup window.
    6. give technical name text_var_name. description any thing.
    7.in global settings, give type of variable "text"
    8. processing type is "replacement path "
    9.Reference char is "calmonth"
    10. in the replacement path tab, in replacement rule, replace variable with "infoobject"
    replace with - "external charecteristic value key"
    11. use interval - select "from value" radio button.
    12. give 4 for offset length.
    13. save & ok.
    But the end result i am expecting 2009 but the result i am getting 2009.05
    But my requirment is to get 2009
    Please advise me on how to proceed
    Thanks

  • Error when using SAP Exit Variable for Current Fiscal Period (0FPER)

    Hi Friendz,
    My requirement is to execute a query for the current fiscal period. I am using the SAP Exit Variable 0FPER.
    I placed this variable on char. Fiscal year/period 0FISCPER.
    When I execute the Query, it is returning the error: No value could be determined for variable ZVBSYCUR; Variables Contain Invalid Values.
    Please give inputs on how to use this variable.
    Regards...
    Ganesh

    Hello Dipika,
    I am also getting the same error.
    ERROR: Variable 0FPER could not be replaced.
    Yesterday we created one customer exit. But this should not affect the SAP Exit right? Till yesterday the 0FPER variable was working fine. I tried re-installing from BI content, but still getting the same error. If anybody has a clue please let me know.
    Thanks,
    Harshal

  • Creating variable for display attribute

    Hi
            I have a requirement where i have to give selection criteria for a display attribute. But how to create a variable for display attribute. Please help.
    Thanks
    Imran.

    If you are in BI 7.0 version. You have to put the navigational attribute in either characteristic restriction (Filter) or default values section and then you will get the restriction option. Once restricted you can put
    that char in where ever you want.
    Regards,
    Kams

  • How to create a variable for key figure (value will be entered by the user

    I want to create one query, where the user has to entered a max value when the query is started, so that only the query rows will be listed, where the key figure value (integer) of the row is smaller than the max value given.
    How can i define that variable which has to start at the begin of the query; and also the restricted key figure iin consideration of the KF variable.
    Thanks for helping
    Ar.

    Hi Arnaud,
                Go to Conditions-> Right click -> New Condition -> Edit -> NEw -> Selct the KEy figures from the dropdown( the KFs that are used in the rows/columns) -> Select Less than from the operator drop down (less than is for you case) -> Values, there is an option to create a variable -> Select the variable -> transfer. It will appear on the top.
    Save & Execute, you will find it in your selction criteria.
    Regards
    Sunil

Maybe you are looking for

  • TS3988 How do I get the email account that was in icloud?

    Hello, my manager handed me his phone off to resolve it and I restored and updated the iphone without knowing who was the account that was set up iCloud, and now I can not activate the phone. How do I get the email account that was in icloud that was

  • Why is it do hard to get a straight answer on Mac security?

    I have the latest OS, Yosemite.  I don't download anything illegally or use software I don't trust.  I basically only use my computer for personal reasons and limit what websites I go to and visit.  I have gone to the apple store and talked to the st

  • How to export slideshow without losing resolution?

    I've used Macs for years, but I'm now having my first experiences with iLife. I've found similar questions to this one discussed here, but not exactly this question, I think. I have created a slideshow in iPhoto, complete with painstakingly set up Ke

  • I need autocomplete  for search for words in a txt. file

    i am not so good in java. I have a running code for search in text with a txt. file (from user bluefox815). But I need a solution with autocomplete for search for words in a txt. file. test_file.txt (Teil des Inhaltes): Roboter robots Mechatronik mec

  • Get the application after launch

    Hi all. I'm using OSGI to launch a JavaFX application. You can see the code below (it's in scala but it is very simple). import org.osgi.framework.{BundleContext, BundleActivator} class BrowserBundleActivator extends BundleActivator {   def start(con