Right way to refer to a sub-mailbox in Mail from AppleScript

Working through an AppleScript to scan MailBoxes in Mail.
The mailboxes are organized as subfolder
Customers
.....CustomerA
.....CustomerB
repeat with theMailbox in every mailbox
set currentMailbox to theMailbox
set mailboxName to the name of currentMailbox
try
set messages_list to every message of mailbox mailboxName
results in
"--> error number -1728 from mailbox "CustomerA"
It works for mailboxes that are not subfolders.
Message was edited by: Kevin Cossaboon

just get rid of the name line. it's quite redundant and messes things up as it chops of the name of the ambient mailbox..
set messages_list to every message of theMailbox
and the full script should be
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 335px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
set ExcludeList to {"Keep", "Trash", "Sent Messages", "Drafts", "Deleted Messages", "Archive"} -- mailboxes you don't want to search
set DestinFolderName to "Archive" -- mailbox to move messages to. If you want to just delete them, leave it blank.
set StaleTime to 160 -- days old the message must be before moved or deleted
set ShowMailboxesProgress to true -- determines if you want the "Processing" box displayed for each mailbox
tell application "Mail"
set everyAccount to every account
-- Get acount-specific mailboxes
repeat with eachAccount in everyAccount
set everyMailbox to every mailbox of eachAccount
set accountName to the name of eachAccount
repeat with theMailbox in everyMailbox
set currentMailbox to theMailbox
set mailboxName to the name of currentMailbox
if mailboxName is not in ExcludeList then
if ShowMailboxesProgress then
display dialog "Processing folder " & mailboxName & " in account " & accountName
end if
try
set messages_list to every message of mailbox mailboxName
repeat with i from 1 to number of items in messages_list
set theMessage to item i of messages_list
set difference to ((current date) - (date sent of theMessage)) div days
if difference is greater than StaleTime then
if DestinFolderName is not equal to "" then
move theMessage to mailbox DestinFolderName
else
delete theMessage
end if
end if
end repeat
end try
end if
end repeat
end repeat
-- Get global mailboxes
repeat with theMailbox in every mailbox
set currentMailbox to theMailbox
set mailboxName to the name of currentMailbox
if mailboxName is not in ExcludeList then
if ShowMailboxesProgress then
display dialog "Processing folder " & mailboxName
end if
try
set messages_list to every message of theMailbox
repeat with i from 1 to number of items in messages_list
set theMessage to item i of messages_list
set s to the subject of theMessage
set difference to ((current date) - (date sent of theMessage)) div days
if difference is greater than StaleTime then
if DestinFolderName is not equal to "" then
move theMessage to mailbox DestinFolderName
else
delete theMessage
end if
end if
end repeat
end try
end if
end repeat
display dialog "Finished!"
end tell</pre>
Message was edited by: V.K.

Similar Messages

  • How do I merge multiple Mailbox e-mails from different Macs in my house?

    The iSync does not quite fix what I'm seeking...a way to merge, not replace, all of my various e-mails that I send on different macs in my home. So, for instance, if I send an e-mail on one of them, I'd like to find that e-mail on my other two.
    Anybody help me on this? Thanks!
    Kevin Krug
    Mac G5, Mac G4, laptop G4   Mac OS X (10.4.6)  

    If you adopt the IMAP account approach first - as long as the IMAP account does not have the same user name and incoming mail server as the POP type account which will allow for creating the IMAP account with the POP account, you can transfer messages from the POP account's Inbox and Sent mailbox to the IMAP account's Inbox and Sent mailbox on each Mac.
    There is no way to merge mailboxes. You can use the Import Mailboxes feature to import the account's Inbox and Sent mailbox from one Mac to another and then transfer messages from the imported mailboxes to the account's Inbox and Sent mailbox in Mail on each Mac.

  • Importing mailboxes into Mail from Entourage only partially works.

    I am trying to import all my Entourage mailboxes into Mail.
    [The background of this is that I want to upgrade to Lion, but my version of Office won't work in Lion and I don't want to pay for a new version, so I'm going to abandon Entourage and use Mail].
    The process appears to work properly; there is no error message and Mail tells me that the mailboxes have been imported into a folder called Import.
    However when I look at the Mail mailbozes, all teh messages are not there. The import has worked up to a point and then just stopped. By this I mean all the actual mailboxes (and sub mailboxes) are in place, tbut only the first 50% or so of the messages are there. (Admitedly, there are a large number of mesages in my mailboxes and the import has worked through them logically by alpahbetical order of mailboxes.)
    I've also tried dragging the missing message across manually, but this doesn't work.
    Any ideas?

    Well there are some suggested solutions on here if you search for them. Hoever, I eventually worked around it by just importing a section of my old email at a time. A bit tedious, but it worked.

  • Is there a way to refer library present in one web application from another

    Hi All,
    I have two web applications deployed in same server. I have a common library for both web applications so i dont want to duplicate it by putting it in WEB-INF\lib of two web applications.
    Is there a way to make it avialble for both application by maintaing the library in one place?
    Thanks,
    Kishore

    You could put it in the common area of your application server, whatever it is. But if it were me, I would just put one copy of the library in each web application. Less scope for classloader problems that way.

  • HT4191 Can I restore my NOTES mailbox to MAIL from a Time Machine backup?

    I am new to the world of discussion so please bear with me.  In trying to resolve a syncing problem between the iMac and iPad, I seem to have somehow deleted all the Notes we had stored.  Can I restore from a Time Machine backup?

    In theory - yes. The backup should restore all of the iPad settings - including mail settings.
    If you backup the iPad with regularity, you do not need to resort to Time Machine. The backups should still be on your Mac.
    iTunes: About iOS backups
    iOS: How to backup (and restore from a backup)
    A very quick rundown on how to restore from a backup. But read the articles above.
    Turn off auto sync first. Launch itunes and go to iTunes>Preferences>Devices. Check the box at the bottom - Prevent iPods, iPhones .... you will see what I mean. Click OK . Quit iTunes.
    Connect the iPad to the Mac and launch iTunes.
    Right Click on the iPad name on the left side under devices.
    Select - Restore from backup
    Then sync with iTunes.

  • Where are my mailboxes and mail?

    Last night I downloaded OS X 10.8.4 to my iMac and now all of my Mailboxes and mail from yesterday back are not visible.  Where can I find them?

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    This time you'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Can't import mailboxes into Mail

    I am trying to import my mailboxes into Mail from my time machine backup but it doesn't work. The backup is from 10.5 and I am now on 10.7. I can't access the old computer I only have time machine. I would also like to import my Address Book contacts. Any tips? Thanks

    Restore the mailboxes to a different location, such as the Desktop, and import them into Mail (File > Import Mailboxes...) I haven't tried this myself and I don't know for sure that it will work.

  • Is there any way to add sub-mailboxes to the Inbox in Mac Mail 4.5?

    So, back when I was using Mail 3.0, I was able to create new mailboxes/folders within the INBOX of a specific account.  When I upgraded my machine, Mail changed to "Locations" with the generic locations "MAILBOXES", and "ON MY MAC", "REMINDERS" as well as locations for any account, say "IMAP" and "EXCHANGE".  Currently, I can add a new mailbox, but my only options are to add to "ON MY MAC" (and any subfolders within), "IMAP", and "EXCHANGE".  The option of adding mailboxes to anything under the "MAILBOX" tab is not an option.
    What I'm wondering is if there is a way to add mailboxes to accounts and have it show up under the MAILBOXES location, rather than under the specific mail account location, as each mail account, ("IMAP", "EXCHANGE") also holds additional folders for Trash, Sent, Drafts, etc.  I have about two to three folders per account that I would like to keep stored on the server, and when Mail is handling multiple accounts, using the "locations" for each account takes up a surprising amount of space.
    I know that there is a way to get sub-mailboxes for each account in the MAILBOXES location (as I currently have several in an IMAP account), but these were all carried over from Mail 3.0 and any additional mailboxes are delegated to the location "IMAP" rather than MAILBOXES/IMAP/sub-mailbox.
    Basically, I'm wondering if I can create mailboxes like this: MAILBOXES/Account/Mailbox rather than ACCOUNT/mailbox
    *I realize I asked the question several times, but hopefully the additional wording helps to solve the issue.

    There is no way to add anything to the face of a photo in iPhoto at all You will need an extenral editror for that kind of work. You can add text and arrows etc with Preview, already on your Mac or with apps like these:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate or the App Store.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • What is the right  way to display a table in Java web dynpro using a node.

    Hi experts,
      I am trying to show a node of cardinality 0...n as a table in an adobe form in Java web dynpro. But its not showing it properly. Can anybody please tell me what is the right way to display a table on adobe form using a node of cardinality 0...n or 1...n in Java Webdynpro.  In ABAP webdynpro, we can drag and drop a node of cardianlity 0...n or 1...n to  show as a table and it works fine. Is the same possible in Java webdynpro also. Please help.
    Thanks and Regards.
    Vaibhav Tiwari.

    Please refer to my post.. you will get the answer
    Dynamic Table -  same data repeating in all rows
    Special care should be taken in designing the context for table attribute.
    The attribute type singletone also plays a important role. I have this doubt from the beginning when you have reported this problem for the first time but finally you marked it as solved so i thought there might be some other issues but again when you reported that again i did some analysis.
    Now coming to final solution :
    For designing a table in adobe interactive form you have consider following
    You have to design the view context upto three level, I am explaining you the properties
    PDFDataSource (Parent Level1) - Cardinality 1:1 - Signetone -True - This is assigned to datasource
    TableList (Parent Level2) - Cardinality (1:1) - Signetone -True
    TableWrapper(Parent Level3) - Cardinality (0:n) - Signetone -True
    TableData (Parent Level4) - Cardinality (0:1) - Signetone - false (This is the main point)
    Then under TableData value node, you have to put all your table attributes.
    This Value Node name can be anything but hierarchy should be same as I have mentioned above.
    Please try out these steps and get back to me if you have any doubt.

  • How to approach ABAP OO programming the right way...

    Hello experts,
    I am an old school procedural ABAP programmer and I recently I have been experementing with ABAP Objects since I've read a few columns the advantages of ABAP OO and also currently learning its syntax. Now, does ABAP Objects conform to the old way of say, doing reports like at selection-screen output, at selection-screen, on value-request for..., start-of-selection, end-of-selection, top-of-page, etc. I have been doing some practice programs and I am not sure if my approach is correct. Example, I created a class named cl1 and I have a method named upload. Now, the UPLOAD method contains the function 'GUI_UPLOAD'. Is this the right way of doing it? Also, How come I cannot create structures inside a class?
    Again, thanks guys and have a nice day!

    Hi,
    I have these three progs from one of the previous posts.
    Good approach on using constructors. I am not finding the original link.
    *& Report ZABAP_OBJ_01 *
    REPORT zabap_obj_01 .
    PARAMETERS : p_vbeln LIKE vbap-vbeln OBLIGATORY,
                 p_matnr LIKE mara-matnr.
    TYPES : BEGIN OF ty_vbap,
    vbeln TYPE vbap-vbeln,
    matnr TYPE vbap-matnr,
    arktx TYPE vbap-arktx,
    END OF ty_vbap.
    * CLASS sales_order DEFINITION
    CLASS sales_order DEFINITION.
      PUBLIC SECTION.
        DATA : v_matnr TYPE mara-matnr,
        v_vbeln TYPE vbap-vbeln.
        METHODS : constructor IMPORTING vbeln TYPE vbap-vbeln
        matnr TYPE mara-matnr OPTIONAL.
        DATA : it_vbap TYPE STANDARD TABLE OF ty_vbap.
        METHODS : get_vbap_details,
        disp_vbap_details.
    ENDCLASS. "sales_order DEFINITION
    * CLASS sales_order IMPLEMENTATION
    CLASS sales_order IMPLEMENTATION.
      METHOD get_vbap_details.
        CLEAR : it_vbap.
        REFRESH : it_vbap.
        SELECT vbeln
        matnr
        arktx
        FROM vbap
        INTO TABLE it_vbap
        WHERE vbeln = p_vbeln.
      ENDMETHOD. "get_vbap_details
      METHOD constructor.
        CLEAR : v_vbeln,
        v_matnr.
        v_vbeln = vbeln.
        v_matnr = matnr.
      ENDMETHOD. "constructor
      METHOD disp_vbap_details.
        DATA : wx_vbap LIKE LINE OF it_vbap.
        LOOP AT it_vbap INTO wx_vbap.
          WRITE :/ wx_vbap-vbeln,
          wx_vbap-matnr,
          wx_vbap-arktx.
        ENDLOOP.
        CLEAR : it_vbap.
      ENDMETHOD. "disp_vbap_details
    ENDCLASS. "sales_order IMPLEMENTATION
    DATA : obj TYPE REF TO sales_order.
    START-OF-SELECTION.
      IF NOT p_matnr IS INITIAL.
        CREATE OBJECT obj EXPORTING vbeln = p_vbeln
        matnr = p_matnr.
      ELSE.
        CREATE OBJECT obj EXPORTING vbeln = p_vbeln.
      ENDIF.
      CALL METHOD obj->get_vbap_details.
      CALL METHOD obj->disp_vbap_details.
    *& report ziga_abapobjects_asgn01 *
      REPORT ziga_abapobjects_asgn01 .
      PARAMETER : p_matnr LIKE mara-matnr.
    * CLASS lcl_material DEFINITION
    CLASS lcl_material DEFINITION.
      PUBLIC SECTION.
        DATA: v_matnr TYPE mara-matnr.
        METHODS : constructor IMPORTING matnr TYPE mara-matnr,
        get_material_description.
      PRIVATE SECTION.
        DATA : v_maktx TYPE makt-maktx.
    ENDCLASS. "lcl_material DEFINITION
    * CLASS lcl_material IMPLEMENTATION
    CLASS lcl_material IMPLEMENTATION.
      METHOD get_material_description.
        CLEAR v_maktx.
        SELECT SINGLE maktx INTO v_maktx
        FROM makt
        WHERE matnr = v_matnr AND
        spras = 'E'.
      ENDMETHOD. "get_material_description
      METHOD constructor.
        CLEAR v_matnr.
        v_matnr = matnr.
      ENDMETHOD. "constructor
    ENDCLASS. "lcl_material IMPLEMENTATION
    DATA : obj TYPE REF TO lcl_material.
    START-OF-SELECTION.
      CREATE OBJECT obj EXPORTING matnr = p_matnr.
      CALL METHOD obj->get_material_description.
      prg3)
      report ziga_abapobjects_asgn01 .
      PARAMETER : p_matnr LIKE mara-matnr.
    * CLASS lcl_material DEFINITION
    CLASS lcl_material DEFINITION.
      PUBLIC SECTION.
        METHODS : constructor IMPORTING matnr TYPE mara-matnr,
        write_material_desc.
        CLASS-METHODS : class_constructor.
      PRIVATE SECTION.
        CLASS-DATA: v_matnr TYPE mara-matnr.
        DATA : v_maktx TYPE makt-maktx.
        METHODS : get_material_description.
    ENDCLASS. "lcl_material DEFINITION
    * CLASS lcl_material IMPLEMENTATION
    CLASS lcl_material IMPLEMENTATION.
      METHOD get_material_description.
        CLEAR v_maktx.
        SELECT SINGLE maktx INTO v_maktx
        FROM makt
        WHERE matnr = v_matnr AND
        spras = 'E'.
      ENDMETHOD. "get_material_description
      METHOD constructor.
        WRITE :/ 'Inside Instance Constructor'.
        CLEAR v_matnr.
        v_matnr = matnr.
        CALL METHOD get_material_description.
      ENDMETHOD. "constructor
      METHOD write_material_desc.
        WRITE :/ 'Material Description :', v_maktx.
      ENDMETHOD.                    "write_material_desc
      METHOD class_constructor.
        WRITE :/ 'Inside Static Constructor'.
      ENDMETHOD.                    "class_constructor
    ENDCLASS. "lcl_material IMPLEMENTATION
    DATA : obj TYPE REF TO lcl_material,
    obj1 TYPE REF TO lcl_material.
    START-OF-SELECTION.
      CREATE OBJECT obj EXPORTING matnr = p_matnr.
      CALL METHOD obj->write_material_desc.
      CREATE OBJECT obj1 EXPORTING matnr = '000000000000000110'.
      CALL METHOD obj1->write_material_desc.
      CALL METHOD obj->write_material_desc.
      prg4)
      report ziga_abapobjects_asgn01 .
      PARAMETER : p_matnr LIKE mara-matnr.
    * CLASS lcl_material DEFINITION
    CLASS lcl_material DEFINITION.
      PUBLIC SECTION.
        METHODS : constructor IMPORTING matnr TYPE mara-matnr,
        write_material_desc,
        get_material_description.
        CLASS-METHODS : class_constructor.
      PRIVATE SECTION.
        CLASS-DATA: v_matnr TYPE mara-matnr.
        DATA : v_maktx TYPE makt-maktx.
    ENDCLASS. "lcl_material DEFINITION
    * CLASS lcl_material IMPLEMENTATION
    CLASS lcl_material IMPLEMENTATION.
      METHOD get_material_description.
        CLEAR v_maktx.
        SELECT SINGLE maktx INTO v_maktx
        FROM makt
        WHERE matnr = v_matnr AND
        spras = 'E'.
      ENDMETHOD. "get_material_description
      METHOD constructor.
        WRITE :/ 'Inside Instance Constructor'.
        CLEAR v_matnr.
        v_matnr = matnr.
      ENDMETHOD. "constructor
      METHOD write_material_desc.
        WRITE :/ 'Material Description :', v_maktx.
      ENDMETHOD.                    "write_material_desc
      METHOD class_constructor.
        WRITE :/ 'Inside Static Constructor'.
      ENDMETHOD.                    "class_constructor
    ENDCLASS. "lcl_material IMPLEMENTATION
    DATA : obj TYPE REF TO lcl_material,
    obj1 TYPE REF TO lcl_material.
    START-OF-SELECTION.
      CREATE OBJECT obj EXPORTING matnr = p_matnr.
      CALL METHOD obj->get_material_description.
      CALL METHOD obj->write_material_desc.
      CREATE OBJECT obj1 EXPORTING matnr = '000000000000000110'.
      CALL METHOD obj1->get_material_description.
      CALL METHOD obj1->write_material_desc.
      CALL METHOD obj->get_material_description.
      CALL METHOD obj->write_material_desc.
      REPORT ziga_abapobjects_asgn01 .
      PARAMETER : p_matnr LIKE mara-matnr.
    * CLASS lcl_material DEFINITION
    CLASS lcl_material DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS : write_material_desc,
        get_material_description,
        class_constructor.
      PRIVATE SECTION.
        CLASS-DATA: v_matnr TYPE mara-matnr.
        CLASS-DATA: v_maktx TYPE makt-maktx.
    ENDCLASS. "lcl_material DEFINITION
    * CLASS lcl_material IMPLEMENTATION
    CLASS lcl_material IMPLEMENTATION.
      METHOD get_material_description.
        CLEAR v_maktx.
        SELECT SINGLE maktx INTO v_maktx
        FROM makt
        WHERE matnr = v_matnr AND
        spras = 'E'.
      ENDMETHOD. "get_material_description
      METHOD write_material_desc.
        WRITE :/ 'Material Description :', v_maktx.
      ENDMETHOD.                    "write_material_desc
      METHOD class_constructor.
        WRITE :/ 'Inside Static Constructor'.
        v_matnr = '000000000000000110'.
      ENDMETHOD.                    "class_constructor
    ENDCLASS. "lcl_material IMPLEMENTATION
    START-OF-SELECTION.
      CALL METHOD lcl_material=>get_material_description.
      CALL METHOD lcl_material=>write_material_desc.
    Arun Sambargi.

  • [Solved]Bash:Manipulating arrays of paths? the right way or not?

    Note: Refer to the following posts for better solutions and/or alternatives.
    This is a mock segment of a script I'm writting and I need to know if I'm doing it the correct way or at least in a proper bash way...
    the following works but will it always parse in a sorted manner. I have a set of directories that are named by date in the YYYY-MM-DD (International) format and want to be sure that they will always be treated as directory paths even when special characters "\n,\t,\s ...etc" are encountered in the path. The number of these directories changes and is compared to a set NUM-ber variable and when there are more than the set number the oldest ones are removed which brings a second question. Being dated as YYYY-MM-DD they sort from oldest to newest(lexicographical order) but do they always and is this the right way to deal with elements in an array separated by nulls? Any Comments or suggestions would be appreciated as I'm learning bash for the  time being (perl is next) and gathered this from bits and peices on verious wikis and forums. I basically want know if this a correct approach to the subject of extracting and performing actions on elements of an array that are directory paths.
    #!/bin/bash
    oifs="$IFS"
    IFS=$'\0'
    DIRTREE=(/path/to/dated/directories/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    NUM=5
    HOWMANYMORE=$(echo $(( ${#DIRTREE[@]} - $NUM )))
    if (( ${#DIRTREE[@]} > $NUM )) ; then
    rm -rv "${DIRTREE[@]:0:$HOWMANYMORE}"
    fi
    IFS="$oifs"
    Note:I have tested this for those wondering
    Last edited by Thme (2012-11-30 16:58:13)

    aesiris wrote:
    there is a special syntax for appending elements to an array:
    array+=(element1 element2 ...)
    you can simplify to
    NUM=3
    combined=()
    for dir in set1 set2 set3; do
    new=(/home/maat/dateddirs/"$dir"/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    (( count= ${#new[@]} - NUM ))
    combined+=("${new[@]:0:$count}")
    done
    This works as really well, however, in my case I still need the other sets in separate arrays for other purposes in my personal script so I adapted the approach a little and got this which uses the array+=(foo) syntax properly now. I was aware of this feature in bash arrays and experimented with it but had no success adding elements from other arrays until you demonstrated it in your example by adding them though a "for loop" and doing the arithmetic there... My current one now is very similar...I'm not sure how to reduce it further if possible but I need the other arrays as I do something completely different with them:
    #!/bin/bash
    NUM=10
    set1=(/home/maat/datedfolders/set1/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set2=(/home/maat/datedfolders/set2/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set3=(/home/maat/datedfolders/set3/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    CT1=$(( ${#set1[@]} - NUM ))
    CT2=$(( ${#set2[@]} - NUM ))
    CT3=$(( ${#set3[@]} - NUM ))
    for X in "${set1[@]:0:$CT1}" "${set2[@]:0:$CT2}" "${set3[@]:0:$CT3}"
    do
    combined+=("$X")
    done
    for
    for Xdirs in "${combined[@]}"
    do
    rm -rv "$Xdirs"
    done
    I'm considering changing the title of this thread as it reveals a little more than I originally expected to go over and provides some pitfalls as well as ways to approach array manipulation which can be applied to wide range of uses in bash scripting. Others may find totally different uses for what we've discussed here so....
    Last edited by Thme (2012-11-30 10:41:02)

  • Keyboard way to open any of my mailboxes without having to scroll?

    Is there a way to use the keyboard to navigate to a particular mailbox? The only thing Ive found is how to move to the inbox, sent, drafts, etc using the command key and a number.
    I can sort my mail into mailboxes, and can save mail to a mailbox using a control click to get to Move To and after using the right arrow I can get to any mailbox by typing its name. After the first few letters Im there.
    How can I do this to simply open a mailbox? In outlook I used to be able to click in the mailboxes pane and begin typing the name. Is there a way to do it with apple mail?
    Thanks,
    Dan

    Where are your song? On an external drive or your system drive?
    Do you remember, when this started? Did you install anything new at that time? Audio plug-ins? Update software? Did you run cleaner applications, like MacKeeper?
    Justs in case this is a problem of failing hardware, is your backup of your system current? This may be a problem of a failing drive.
    Try to narrow down the problem by making a few tests.
    Can you save and open GarageBand projects on a different drive? For example thumbsdrive?
    Can you open and save GarageBand projects when working from a different user account, see: Isolating an issue by using another user account
    Can you open and save GarageBand projects when working in Safe Mode? See: Mac OS X: What is Safe Boot, Safe Mode?  and Mac OS X: Starting up in Safe Mode
    Please report back, when you know, if a different drive, a different account, or safe boot mode change anything.
    Regards
    Léonie

  • Is bgRFC Out-Inbound the right way for this... ?

    Hi guys,
    my scenario is:
    n systems (SAP) send data to ONE server (AS ABAP). The data will delivered via one and the same RFC FM to be stored in exactly ONE file per day.
    I have to ensure quality of service and delivery.
    So my first question is if bgRFC is the right way of doing so...
    MY idea was: I have exactly ONE inbound queue name on server/central system to ensure, that there will be only one unit to write data into file at the same time...
    Second: when the sender system calls one function module several times, how do I have to configure the queue names...
    I'm facing problems regarding this (please see below)
    the error occurs whenever the FM is called more than once per unit and I have only ONE inbound queue name declared...
    (please see coding below)
    Any ideas on that?
    Best -
    Christoph
    coding example....
      DATA:
            my_destination TYPE REF TO if_bgrfc_destination_outbound,
            my_unit        TYPE REF TO if_qrfc_unit_outinbound,
            dest_name      TYPE bgrfc_dest_name_outbound,
            queue_name     TYPE qrfc_queue_name,
          dest_name = 'SID'.
          my_destination = cl_bgrfc_destination_outbound=>create( dest_name ).
    loop... (to split XLarge amounts of data)
    CALL FUNCTION 'MSGRECEIVER'
        IN BACKGROUND UNIT my_unit
    exporting lt_data
    endloop...
    my_unit->add_queue_name_outbound( QUEUE_NAME = '<prefix>_OUT'
    my_unit->add_queue_name_inbound( QUEUE_NAME = '<prefix>_IN'
                                            IGNORE_DUPLICATES = abap_true ).
    Problem:
    the error occurs, when more than one function module is called by the sender system... and having only ONE inbound queue name declared...
    Edited by: Christoph Aschauer on Jul 28, 2011 1:08 PM

    Start here to learn After Effects:
    http://adobe.ly/AE_basics
    This series of videos ends with exporting to H.264 (.mp4):
    https://helpx.adobe.com/creative-cloud/learn/start/aftereffects.html

  • The "right" way to handle multiple devices, accounts and the cloud?

    Perhaps a bit premature, but I figure it's never too early to start planning. 
    Here's our current setup - I currently have four iDevices in the faily (three iPhones and one iPod Touch.  All are syncing to the same Mac Mini, albeit with different logins (and different iTunes store ids).  All four of these are kept in sync via Home Sharing so we have access to the music/apps/etc acquired by the others.
    Enter the iCloud - how does this fit in?  What's the *right* way to do this? 
    I can see two options:
    1)     Continue to utilize four iTunes store ids, sync them via Home Sharing and add four iClouds
         Advantages
              totally independent devices, users, etc.
         Disadvantages
              must pay for four "iTunes Match" services to access non-iTunes music on each of the four devices
              will iTunes-purchased music automaticaly sync to iCloud if it is shared via Home Sharing (or only by the original purchaser)?
    2)     Use one iTunes Store id for all iDevices
         Advantages
              single point of acquisition and distribution for all devices
         Disadvantages
              need to find a way to merge IDs (is this even possible?)
    Are there other advantages/disadvantages to these options?  Are there other options?  What's the easiest to set up and support?  Any other thoughts?
    Thanks in advance for your input.

    Well it seems like the first thing you should do is consolidate your iTunes libraries so that you don't have 4 copies of everything, one for each user logged in to your Mac Mini. How you do that is consolidate all 4 iTunes folders to one folder located in the /Users/Shared/ folder and update each of your iTunes to point to that folder accordingly. That way you have one iTunes library, only one copy of your media, but accessible from multiple users.
    One caveat is that if somebody is logged on and has iTunes open, you can't fast switch to another user and open iTunes. Apple made it so that only one user and one instance of iTunes can open a iTunes library at a time.
    For your iTunes match situation, it does sound like you would be much better off sharing a single Apple ID with one iTunes Match. For consolidating, make sure you have everything everybody has shared via Home Sharing to the main account you'd like to move over to, and then simply go to each device Settings, Store, and the sign out of the original Apple ID and logon using the shared main Apple ID. I just looked at it and the automatic downloading is already live in iOS! You can specify if you want to do music, apps, and books separately in case you may want to automatically download music but not apps or books.

  • Problem with slideshow in iPhoto. Photos look like they are all the right way up but when in slideshow action some are sideways.

    even though all photos look like they are the right way up, when the slideshow commences, some of them display sideways. I have tried re-rotating them - and still have same problem. Help please - need it for Saturday night !

    What version of iPhoto are you using?  Are you creating the slideshow directly from an album or are you using the slideshow mode?
    As a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos and test to see if the same problem persists. Does it?
    OT

Maybe you are looking for

  • Decimal places are not displayed in smartforms

    Hi,   Iam having a quantity field which has length 13 and decimals 3. While debugging it has the value has decimal places but while displaying it does not have the decimal places. Only the whole number is displayed. Can anyone help how to rectify thi

  • How is percieved loudness calculated

    Excactly which frequency weighting is used to calculate the percieved loudness. The info I can find just says something about the midrange frequncies but are not very specific?

  • Backup disk already in use

    backup fail - The backup disk image "/Volumes/Data/Wong Keng Pung's Computer (2).sparsebundle" is already in use.

  • Affichage tabulaire

    J'ai cree un block de donnies format tabulaire de 15 lignes. J'ai cree un 2 eme block tabulaires de 16 lignes avec un lien sur le premier block ( lien de forme :block1.code=:block2.code) dans le bloc 2 je souhaiterais qu'il m'affiche les 16 lignes en

  • Convert php to c++, with HipHop from ....Facebook

    I haven't tried this out yet, but looks cool... any comments, would be much appreciated http://github.com/facebook/hiphop-php/wiki Last edited by scarletxfi (2010-10-30 14:39:40)