Get app.documents[???] for the activeDocument

An example:
I have 10 opened images in photoshop.
I start working on the last one, then the one before, and so on until the 8th image.
1, 2, 3, 4, 5, 6 are opened
7, 8, 9 are finished and must be saved.
I want an action that will save the activeDocument and all the ones after that: in the example will save the 7th 8th and 10th image.
Is this possible?
I have everything but I don't know how to get the number for the activeDocument >>> app.documents[???]

The quick way doesn't always work.
For instance:
1) File > New...
2) 3D > New Shape From Layer > Cube Wrap
3) Image > Duplicate...
Then run your code (slightly modified):
function getActiveDocumentIndex(){
     var ref = new ActionReference();
     ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
     return desc = executeActionGet(ref).getInteger(stringIDToTypeID('itemIndex'))-1;
var index = getActiveDocumentIndex();
alert('The activeDocument is app.documents['+getActiveDocumentIndex()+']');
alert(app.documents[index].name);
It thinks the duplicated doc is [2] instead of [1] then fails when you try to get the name. This is apparently an artifact of the 3D system introducing new pseudo-documents internally when you have 3D layers.
You end up have to use something like this to get the actual DOM index:
function getDocumentIndex(doc) {
  var docs = app.documents;
  for (var i = 0; i < docs.length; i++) {
    if (docs[i] == doc) {
      return i+1;
  return -1;
This is a CS5/Extended problem but the problem may present itself in other ways.

Similar Messages

  • Getting apps/music for the iPhone?

    Ordered the iPhone 3G S and it will be my 1st iPhone. When you get apps or music for the iPhone does it work like doing the same for the iPod Touch where you pay for everything through your iTunes/Apple account or will whatever apps/music you get from iTunes go on monthly phone bill.

    Great thanks. I like it that way better so I can use iTunes gift cards.

  • I purchased quicken through the app store and it will not download. Can I get a refund for the app?

    I purchased quicken through the app store and it will not download. Can I get a refund for the app?

    Disable anti virus softwrare if installed
    Check your settings in System Preferences > Security & Privacy > Firewall > Firewall Options
    Make sure Gatekeeper is enabled
    Open System Preferences > Security & Privacy then select the General tab.
    Make sure either Mac App Store or Mac App Store and identified developers is selected. If that area is grayed out, click the padlock icon to proceed.
    OS X: About Gatekeeper
    Then try downloading Quicken >  Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Just so you are aware, "all sales are final" as noted here >  iTUNES STORE - MAC APP STORE:   TERMS AND CONDITIONS
    But you can at least ask for a refund > Apple - Support - Topic Selection

  • How I could get a receipt for the purchase i made in the app store?

    I just purchased an app for my iMac and I was wondering how I could get a receipt for the purchase?

    The redeipt comes in the your email automatically in 24 to 48 hours.

  • Preparation of AS IS and TO BE Documents for the MM Related Areas

    Hi All,
    Can you please help me in preparation of AS IS and TO BE Documents for the MM Related Areas.
    Thanks in advance.
    Unmesh

    Unmesh,
    You need to have discussions with business to analyse what should be included in TO BE and what should be in AS IS.
    You can try preparing the documents, let me know where you get doubts.
    Raghavan

  • In Which Table  I Will get Reference Document for MIGO Transaction

    Hai Experts
    In Which Table  I Will get Reference Document for MIGO Transaction
    Regards
    Jagadish

    Hi,
    The 2 main tables for this MIGO Transaction are ,
    MKPF - Header table
    MSEG -  Item table
    Reference Document is XBLNR.
    Regards,
    Raj.

  • No FI document for the GR created thru SRM confirmations

    Hi
    Can any one clarify me, why there will be no FI document for the GR which is created in the backend which thru SRM confirmations. This is a classic scenario ver 4.0
    Please suggest me.
    Regards
    Srujan.k

    Hi,
    Make sure that the Purchase Order Line item does not have tick mark on 'GR non-valuated' indicator. If this is so, the FI document will not be posted at the time of confirmation, and it will be posted at the time of Invoice Posting (MIRO Transaction). There will not be any GR/IR Posting if above indicator is tick marked.
    As Sanjeev mentioned, the 'GR non-valuated' indicator gets tick marked automatically if you distribute the cost to mulitple cost objects OR if you have set up Account Assignment Category in such a way that GR non-valuated is tick marked by default. Please check either of them.
    Regards,
    Ashok B Kawa

  • Can create twice billing document for the same delivery in STO

    Hi experts,
    I donot have problems in Standard Sales order when I create billing doc via VF01. When I try to create another billing doc in VF01 for the same delivery it says error, as the item is already invoiced.
    This is correct. 
    But while creating invoice for STO order, system allows me to create more than 1 billing document for the same delivery. If we accidentally or purposefully create it allows to create many.
    Could you let me know where in SPRO (IMG) I can control this?
    Thanks,
    Pri

    Hi
    STO billing if it is intercompany STO followed by IV billing type you can create only once
    No special settings reqd to achieve this as you bill  (IV billing type) the delivery the first time, the delivery status gets completed
    If Intracompany, the billing type is proforma invoice F8  and this can be created as many times as you wish as proforma doesnot update accounting
    if your issue is this
    Even this also if you want to restrict only once then try with copying requirenments 311 at item level (i hope standard item category NLN is used) in VTFL between header NL to F8
    Regards
    Raja

  • TS1424 i have purchiced a cd from the ituns store but it seems to keep downloading how do i stop this and get a refund for the extra cd

    I have downloaded a CD from the itunes store but it seems to keep downloading. how do i stop this and get a refund for the unwanted CD's

    Welcome to the Apple Community.
    Try deleting the problematic file (electing to remove original file if/when prompted) and then re-downloading the file from the iTunes store.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option from the Quick Links section in the top right corner of the iTunes homepage in your iTunes application on your computer.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option at the bottom of the screen of the iTunes app (or video app) on your iOS device.
    If the problem re-occurs, select the content which is causing a problem and use the 'Report a problem' button in Your Purchase History using your computer.

  • TS1424 I'm being charged twice for the same order. Playtika coin purchases are a problem on Ipod.  How do I get a credit for the coins I did not get?

    Did anyone else have problems with in App purchases from an IPod?  I get charged twice for the same order...  How do I get a credit for the coins not received?

    Try contacting iTunes support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How can I get null values for the later weeks

    Hi All,
    When I execute this code I get the records till current week.
    How can I display the output so that I get null values for the later weeks. (with the help of v_numOfWeeks variable in the code)
    Thanks,
    Vikram
    DECLARE
       v_query VARCHAR2(4000);
       TYPE ref_cursor IS REF CURSOR;
       v_refcur ref_cursor;
       v_sum NUMBER;
       v_id NUMBER;
       v_name VARCHAR2(1000);
       v_weeknum NUMBER;
       v_pernum NUMBER;
       v_numOfWeeks NUMBER := 5;
    BEGIN
    v_query := ' SELECT SUM(product_bkg), postn_id, postn_tbl.postn_name, b.week_num, b.period_num
                              FROM ops_cv_extract b, (SELECT row_id, desc_text postn_name
                          FROM s_postn) postn_tbl
                          WHERE lvl_6_id = 5767
                          AND fiscal_year = 2008
                          AND b.week_num < 4
                          AND b.period_num = 3
                          AND b.postn_id = TO_NUMBER(postn_tbl.row_id)
                          GROUP BY postn_id, postn_tbl.postn_name, b.week_num, b.period_num
                          ORDER BY  postn_tbl.postn_name, b.week_num';
    OPEN v_refcur FOR v_query;
    LOOP
       FETCH v_refcur INTO v_sum, v_id, v_name, v_weeknum, v_pernum;
       EXIT WHEN v_refcur%notfound;
       dbms_output.put_line('P'|| v_pernum||'W'|| v_weeknum||' '||v_name||' '||v_sum);
    END LOOP;
    END;
    This is the output when I execute this code.
    P3W1 COMM CNTRL ISAM 213 26961.61
    P3W2 COMM CNTRL ISAM 213 12870.4
    P3W3 COMM CNTRL ISAM 213 245.88
    P3W1 COMM CNTRL ISAM 273 72831.2
    P3W2 COMM CNTRL ISAM 273 8739.38
    P3W3 COMM CNTRL ISAM 273 3764.92
    P3W1 COMM CNTRL TAM 213 49844
    P3W2 COMM CNTRL TAM 213 20515.17
    P3W3 COMM CNTRL TAM 213 16167.46
    P3W2 COMM CNTRL TAM 216 12561.4
    P3W3 COMM CNTRL TAM 216 2027.1
    P3W1 COMM CNTRL TAM 273 -3336.71
    P3W2 COMM CNTRL TAM 273 -1376.68
    P3W3 COMM CNTRL TAM 273 19707.42
    P3W1 Damon Walters -609.07
    P3W2 Damon Walters 30030.24
    P3W3 Damon Walters 37475.1
    This is the output I'd like to get
    P3W1 COMM CNTRL ISAM 213 26961.61
    P3W2 COMM CNTRL ISAM 213 12870.4
    P3W3 COMM CNTRL ISAM 213 245.88
    P3W4 COMM CNTRL ISAM 213
    P3W5 COMM CNTRL ISAM 213
    P3W1 COMM CNTRL ISAM 273 72831.2
    P3W2 COMM CNTRL ISAM 273 8739.38
    P3W3 COMM CNTRL ISAM 273 3764.92
    P3W4 COMM CNTRL ISAM 273
    P3W5 COMM CNTRL ISAM 273
    P3W1 COMM CNTRL TAM 213 49844
    P3W2 COMM CNTRL TAM 213 20515.17
    P3W3 COMM CNTRL TAM 213 16167.46
    P3W4 COMM CNTRL TAM 213
    P3W5 COMM CNTRL TAM 213
    P3W1 COMM CNTRL TAM 273 -3336.71
    P3W2 COMM CNTRL TAM 273 -1376.68
    P3W3 COMM CNTRL TAM 273 19707.42
    P3W4 COMM CNTRL TAM 273
    P3W5 COMM CNTRL TAM 273
    P3W1 Damon Walters -609.07
    P3W2 Damon Walters 30030.24
    P3W3 Damon Walters 37475.1
    P3W4 Damon Walters
    P3W5 Damon Walters Edited by: polasa on Oct 28, 2008 6:42 PM

    Sure, in a Single SQL ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>-- Start Of Test Data --
    satyaki>with week_tab
      2  as
      3    (
      4      select 1 period_num, 1 week_num, 10 bkg1 from dual
      5      union all
      6      select 1, 2, 40 from dual
      7      union all
      8      select 1, 3, 30 from dual
      9      union all
    10      select 1, 2, 20 from dual
    11      union all
    12      select 1, 1, 10 from dual
    13      union all
    14      select 1, 1, 20 from dual
    15      union all
    16      select 1, 3, 10 from dual
    17      union all
    18      select 2, 1, 15 from dual
    19      union all
    20      select 2, 2, 20 from dual
    21      union all
    22      select 2, 3, 10 from dual
    23      union all
    24      select 2, 1, 15 from dual
    25      union all
    26      select 2, 2, 30 from dual
    27      union all
    28      select 2, 3, 20 from dual
    29    )
    30  -- End Of Test Data --
    31  select period_num,
    32         week_num,
    33         (
    34            select sum(week_tab.bkg1)
    35            from week_tab
    36            where period_num = m.period_num
    37            and   week_num   = m.week_num
    38            group by week_num, period_num
    39         ) sum_bkg1
    40  from (
    41        select dum.week_num,
    42              wk.period_num
    43        from (
    44                select 1 week_num from dual
    45                union all
    46                select 2 from dual
    47                union all
    48                select 3 from dual
    49                union all
    50                select 4 from dual
    51                union all
    52                select 5 from dual
    53              ) dum ,
    54              (
    55                select distinct period_num
    56                from week_tab
    57          ) wk
    58      ) m;
    PERIOD_NUM   WEEK_NUM   SUM_BKG1
             1          1         40
             1          2         60
             1          3         40
             1          4
             1          5
             2          1         30
             2          2         50
             2          3         30
             2          4
             2          5
    10 rows selected.
    Elapsed: 00:00:00.48
    satyaki>Regards.
    Satyaki De.

  • How to get Open Balance for the year and Total Ending Balance?

    For a given account, how to get Open Balance for the year (Cumulative Ending Balance) and Total Ending Balance (Cumulative Ending Balance)?
    Is there any function module available? or should I read from some tables? Please advice.

    Hello Paul,
    You could try calling one of the following BAPIs - see which one meets your requirement. They are documented well so shouldn't be a problem finding out the correct one for your requirements.
    BAPI_GL_GETGLACCBALANCE      
    BAPI_GL_GETGLACCCURRENTBALANCE
    BAPI_GL_ACC_GETBALANCE      
    BAPI_GL_ACC_GETCURRENTBALANCE
    BAPI_GL_ACC_GETPERIODBALANCES
    BAPI_COND_VAL_DECRE_BALANCES
    You might have to put in some of your own logic after the BAPI call to get what you want.
    Hope this helps,
    Cheers,
    Sougata.
    p.s. Also look at FM FAGL_GET_ACCOUNT_BALANCE
    Edited by: Sougata Chatterjee on May 7, 2008 11:47 AM

  • Any Function module or BAPIs are available to get scheme name for the inter

    I have internal order no value in table  AUFK-AUFNR ,  and the internal order corresponding Scheme value is available in IMPR-PRNAM . Now I want to inner join both the tables to extract the data , but there is no common field . Is there any Function module or BAPIs are available to get scheme name for the internal orders?

    look at DB-VIEW  "V_IVP_OR".
    Regards,
    Laurent

  • Why does my wife's calendar app ask for the password to my calendar account?

    My wife and I used to have iPhone 4's. We each have a Google calendar, and we had our calendar apps set up so that each iphone would show both calendars. We never had any trouble.
    Recently my wife and I switched to iPhone 5c's. Since then, whenever my wife tries to enter something into the calendar, the app asks for the password to my account. I don't have that problem on my phone. I'm pretty sure the phone apps are set up the same way. What gives?

    It is possible that those 2 calendars are syncing Google accounts and being shared.  My friend shares her calendar with me and it shows up in my calendar.

  • When I download itunes, it says that Ipod Service failed to start. I checked the services under task manager and when I try to start it, it says access denied. How to I get access and for the ipod service to start and run?

    Please help. My ipod classic could not be recognised by itunes when I connect my ipod to PC. Previously it has been recognised before I updated. This was a while ago now and so I removed all apple files and re installed the latest itunes but am having the same problem.
    When I download itunes, it says that Ipod Service failed to start. I checked the services under task manager and when I try to start it, it says access denied. How to I get access and for the ipod service to start and run?

    Some anti-virus programs (e.g., McAfee) have this rule that can be invoked under the "maximum protection" settings: PREVENT PROGRAMS REGISTERING AS A SERVICE. If that rule is set to BLOCK, then any attempt to install or upgrade iTunes will fail with an "iPod service failed to start" message.
    If you are getting this problem with iTunes, check to see if your anti-virus has this setting and unset it, at least for as long as the iTunes install requires. Exactly how to find the rule and turn it on and off will vary, depending upon your anti-malware software. However, if your anti-virus or anti-malware software produces a log of its activities, examining the log may help you find the problem.
    For example, here's the log entry for McAfee:
    9/23/2009 3:18:45 PM Blocked by Access Protection rule NT AUTHORITY\SYSTEM C:\WINDOWS\system32\services.exe \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\iPod Service Common Maximum Protection:Prevent programs registering as a service Action blocked : Create
    Note that the log says "Common Maximum Protection: Prevent programs registering as a service". The "Common Maximum Protection" is the location of the rule, "Prevent programs registering as a service" is the rule. I used that information to track down the location in the McAfee VirusScan Console where I could turn the rule off.
    After I made the change, iTunes installed without complaint.

Maybe you are looking for

  • MacBook screen is broken

    I woke up this morning and took out my MacBook. When I turned it on, I noticed this spider-web crack in the screen (the LED part, not the glass.) What should I do? I'm trying to stay away from Best Buy, as they will rob my wallet and then some.

  • Windows hijacks iPod and treats like flash drive.

    every time I connect my new ipod to my computer (vista) windows explorer opens up and shows an empty drive, so I close that and then iTunes opens and try's to sync, after 40 songs windows hijacks it, disconnects it, re-connects it and opens it again

  • Connection Pool Name Missing from Drop Down when Creating a New Datasource

    Hi All, I'm running Weblogic Server 8.1. I've successfully created a connection pool for DB2 using the Non-XA JDBC driver from IBM (Version 7.1). When I attempt to create a datasource for this pool and un-check the "Honor Global Transactions" checkbo

  • CRAM Codec & Premiere CS3

    I'm doing some simple editing in Premiere CS3.  My pre-recorded videos play fine in Windows Media Player, but export jerky and vibrating after editing them. After doing some research I found out that my pre-recorded videos us the CRAM (Microsoft Vide

  • Sorry. One More OnyX Question!

    Sorry. I just realized I had one more question pertaining to OnyX. When I'm on the Optimization page, it says to either "update" or "complete optimization" options for optimization. What do either of those options mean? I'm just a little scared to tr