Applescript, how can i sort files by the way they start?

I have a folder on the Desktop called "HotFolder" This is where all the images are stored.
They are uniquely named (either jpg's or PSD's) They begin FR10xxxxxxxxxxxx ES20 TM15 etc, Each of these refer to image type.
On the Desktop there are folders named FR10_WK10, ES20_WK10, TM15_WK10
Each week the folder name changes but only the digits after WK10 So the first 4 digits are consistent.
I'm looking for an applescript to sort these files so it sorts all files beginning with FR10 to go into folder  that begins FR10 and TM15 in to folder that begins TM15.
I've very little experience with it applescript, only good and modifying it after. So if anyone can help me out with this it would be much appreciated.
Many Thanks

Jacques Rioux wrote:
MattJayC wrote:
I get the response
error "Finder got an error: Can’t get 1." number -1728 from 1 to «class furl»
I think that it might not work as the folder name doesn't always start with the same ie
Yes, the folder doesn't exist.
Here another approach
tell application "Finder"
    set theHotFolder to folder "HotFolder Copy"
     move (files of theHotFolder whose name starts with "BU") to (get first folder of desktop whose name starts with "Bugess2do")
     -- this moves every "TM...." and "CC...." files  to folder "TM15...."
     move (files of theHotFolder whose name starts with "TM" or name starts with "CC") to (get first folder of desktop whose name starts with "TM15")
     --- another example
     move (files of theHotFolder whose name starts with "FR") to (get first folder of desktop whose name starts with "FR10")
     move (files of theHotFolder whose name starts with "ES") to (get first folder of desktop whose name starts with "ES20")
end tell
Add  lines for other name.
SUPERB WORKS LIKE A DREAM!!!!!
Thankyou

Similar Messages

  • How can I sort files in a folder by name?

    How can I sort files in a folder by name? iFS first sort files that starts with upper-case letter and then files with lower-case letter.
    Like:
    A_file
    B_file
    a_file
    b_file
    I want:
    A-file
    a_file
    B_file
    b_file
    This doesn't help:
    String[] sort_attributes = {"NAME"};
    boolean [] sort_orders = {true};
    SortSpecification sort = new SortSpecification(sort_attributes, sort_orders);
    currentFolder.setSortSpecification(sort);
    Do I have to get all items in a folder and then sort them?
    /Elin

    I do not think there is a way to do that without add-ons
    There are a couple of workarounds I am aware of
    * Add the bookmarks manually in the bookmarks library and choose the position. That is using Show all bookmarks -> open required folder -> select a position and right click -> add new bookmark <br />Rather a slow and clumsy process
    * Sort a folder and copy it. If you sort the folder contents then copy and paste them they remain in that order when pasted.
    There are add-ons but I have not tried them. For example
    * https://addons.mozilla.org/firefox/addon/simplesort-bookmarks/
    * https://addons.mozilla.org/firefox/addon/auto-sort-bookmarks/
    There will be others available and take note of the advice to backup bookmarks manaully.
    * [[Restore bookmarks from backup or move them to another computer#w_manual-backup]]_manual-backup

  • I have a G4 Quicksilver that no longer works, but the hd may still be good. How can I get files off the G4 hd and onto my new iMac?

    I have a G4 Quicksilver 2001 that no longer works, but the hd may still be good. How can I get files off the G4 hd and onto my new late 2013 iMac?

    Also, how do I boot the G4 into FireWire Target Disk mode?
    First, the G4 must be able to start to use FWTDM. If it can start, hold the t key at boot until you get a "screensaver pattern" that looks like this:
    If the G4 is attached via a FireWire cable to a newer Mac with a FireWire port, the G4's hard drive will appear on the other Mac's desktop just as if it were any external drive. A USB cable won't work for FWTDM.
    Just wondering if the drive in my G4, which I believe may be an ATA drive will also work in an enclosure for a SATA drive?
    No. ATA (actually "PATA" or "IDE") and SATA are different interfaces. PATA external enclosures are now very hard to find. You best and least expensive option is the adaptor that BDAqua linked. One of its connectors is for PATA drives.

  • My ipad has gone in lost mode by mistake and now i have it and i enter the password and i cant enter my ipad how can i enter or restart the ipad and start back over new

    my ipad has gone in lost mode by mistake and now i have it and i enter the password and i cant enter my ipad how can i enter or restart the ipad and start back over new

    FORCE IPAD INTO RECOVERY MODE
    1. Turn off iPad
    2. Turn on computer and launch iTunes (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port.
    DO NOT RELEASE BUTTON until you see picture of iTunes and plug
    5. Release Home button.
    ON COMPUTER
    6. iTunes has detected iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
    7. Select "Restore iPad"...
    Note:
    1. Data will be lost if you do not have backup
    2. You must follow step 1 to step 4 VERY CLOSELY.
    3. Repeat the process if necessary.

  • Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to be?

    Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to look?
    Everyone who logs into Facebook on my Firefox has this problem however if we use Internet Explorer - facebook looks normal.

    If you have increased the minimum font size then try the default setting "none" as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"

  • How can i sort files and pick the latest among them

    Hi ABAPers
    I have a problem with sorting files. I have files coming from FTP into my Presentation server.Files are like
    3160SNIM_2007061201090010.in
    3160SNIM_2007061201190011.in
    3160SNIM_2007061201290015.in
    3360SNIM_2007061201490017.in
    3360SNIM_2007061201390014.in
    3360SNIM_2007061201490018.in
    3360SNIM_2007061201190013.in
    Among these files i should filter the files with 3160 and 3360. and among filtered files i should pick the most recent file of both 3160 and 3360 and put them in another internal table. I am getting stuck how to justify this requirement. Not only 3160 and 3360 i have few more like that. Please help me out.

    HI,
    let us  say itab contains ur files.
    data : begin of jtab occurs 0,
              fnamedate(20) type c,
              time(20) type c,
              end of jtab.
    data : begin of ktab occurs 0,
             filename(30) type c,
             end of ktab.
      Loop at itab.
    lv_len = strlen(itab-file).
      jtab-fnamedate = itab-file+0(17).
    lv_len = lv_len - 17.
    jtab-time  = itab+17(lv_len).
    append jtab.
      endloop.
    sort jtab by fnamedate time descending.
    loop at jtab.
    at new jtab-fnamedate.
    concatenate jtab-fnamedate jtab-time into ktab-filename.
    append ktab.
    endat.
    endloop.
    After this loop ktab will contain latest files.
    Thanks
    Mahesh

  • How can I remove files from the startup disk

    I am getting a screen when I am trying to quit saying   the "MAC OS X startup disk has no more space available for application memory"  by closing the windows and removing files from the startup disk will help.
    How do I do this?

    That error message is misleading. Your problem is excessive swapping of data between physical memory and virtual memory.
    That can happen for two reasons:
    You have a long-running process with a memory leak (i.e., a bug), or
    You don't have enough memory installed for your usage pattern.
    Tracking down a memory leak can be difficult, and it may come down to a process of elimination.
    In the Activity Monitor application, select All Processes from the menu in the toolbar, if not already selected. Click the heading of the  Real Mem column in the process table twice to sort the table with the highest value at the top. If you don't see that column, select
    View ▹ Columns ▹ Real Memory
    from the menu bar.
    If one process (excluding "kernel_task") is using much more memory than all the others, that could be an indication of a leak. A better indication would be a process that continually grabs more and more real memory over time without ever releasing it. Here is an example of how it's done.
    The process named "Safari Web Content" renders web pages for Safari and other applications. It uses a lot of memory and may leak if certain Safari extensions or third-party web plugins are installed. Consider it a prime suspect.
    If you don't have an obvious memory leak, your options are to install more memory (if possible) or to run fewer programs simultaneously.
    The next suggestion is only for users familiar with the shell. For a more precise, but potentially misleading, test, run the following command: 
    sudo leaks -nocontext -nostacks process | grep total
    where process is the name of a process you suspect of leaking memory. Almost every process will leak some memory; the question is how much, and especially how much the leak increases with time. I can’t be more specific. See the leaks(1) man page and the Apple developer documentation for details.

  • How can you sort bookmarks in the Sidebar by date added? Works in Library but does not carry over to Sidebar.

    When opening the Bookmarks Sidebar, the oldest bookmarks added are at the very top, easily visible.
    The most recent bookmarks added are at the bottom, requiring me to scroll all the way down every time I want to visit a recent bookmark. This is a major nuisance. I'm actually a little shocked that this happens when it's such an obvious hassle.
    How can I flip the list of bookmarks so the newest ones are right at the top where I can easily access them?
    Sorting in the Library does not carry over to the Sidebar as far as I can tell.

    Looks as though the SortPlaces add-on should be able to do it.
    Similar thread: [http://support.mozilla.com/fur/questions/771606 I would like to find a way to save my bookmarks unsorted but with the newest saves at the top of the list. I don't want alphabetical order. 3.6.13 | Firefox Support Forum | Firefox Help]
    Add-on: [https://addons.mozilla.org/en-US/firefox/addon/sortplaces/ SortPlaces :: Add-ons for Firefox]

  • How can I put files into the trash without login every time?

    Every time I want to put items in the trash, after dragging things to the basket, I have to sign in.  Why? Can I set the defaul to allow me to do so without login?

    The procedure below will reset the permissions of a user's home folder in OS X 10.7.4 or later, including 10.8 or later. If you're running an earlier version of 10.7, update to the latest version first. This procedure should not be used under OS X versions older than 10.7.4.
    Back up all data before you begin.
    Step 1
    Click the Finder icon in the Dock. A Finder window will open.
    Step 2
    Press the following key combinations, in the order given:
    Command-3
    Shift-command-H
    Command-I (the letter "I" as in "Info.")
    The Info window of your home folder will open.
    Step 3
    Click the lock icon in the lower right corner and authenticate with the name and login password of an administrator on the system. If you have only one user account, you are the administrator.
    Step 4
    In the Sharing & Permissions section of the window, verify that you have "Read & Write" privileges. If not, use the "+" and "-" buttons in the lower left corner to make the necessary changes.
    Step 5
    By default, the groups "staff" and "everyone" have "Read Only" privileges. With those settings, the files at the top level of your home folder will be readable by other local users. You can change the privileges to "No Access" if you wish, but then your Public and Drop Box folders will be inaccessible to others. Most likely, you don't need to change these settings.
    Step 6
    If there are entries in the Sharing & Permissions list for users or groups other than "me," "staff," and "everyone," delete them.
    Step 7
    Click the gear icon at the bottom of the Info window and select Apply to enclosed items... from the drop-down menu. Confirm. The operation may take several minutes to complete. When it does, close the Info window.

  • I have just put an audio book into my iTunes music library.  When I tried to transfer it to my iPod shuffle it rearranged the tracks so that they are in the wrong order.  How can I put them in the order they appear in the book?

    I have just put an audio book into my iTunes music library.  When I tried to transfer it to my iPod Shuffle it put the chapters in the wrong order i.e. Chap 1, Chap 10, Chap 11 etc. rather than Chap 1, Chap 2, Chap 3 ...  How can I get it to put them in the order they appear in the book?

    First, we need to know if the audiobook chapters are being treated by iTunes as music files or as audiobooks. If they are not audiobooks purchased from the iTunes store, they might be getting "shuffled". You will need to look at "File" - "Properties" (I think - I don't use iTunes under Windows - or right-click on the file and choose "properties") and look at the media type. If it is "Music", change it to "Audiobook". If this is not the problem, or does not fix anything, please post back.
    Actually, looking at your post again, a second thought occurs to me - assuming there are less than 100 chapters in the book, just renaming them with a leading zero on the first nine chapters might do it. A computer will alphabetically sort filenames in the order you quote (1, 10, 11, 12, 13, ... 2, 21, etc.) but a leading zero will fix that (01, 02, 03 ... 10, 11, 12)

  • GUI organization is messed up - how can I put it back the way it was

    SQL Developer 2.1.1.64
    was running fine, then somehow the GUI got messed up so now connections view takes up half the screen and I can't see the SQL windows and the tables windows. How can I put it back to the way it was? Any time I try to drag and move a window around, it gets worse. I would like to have the connections view only in the left quarter of the window as the default.

    If you simply want to reset everything to default you can backup/delete the settings directory usualli located in:
    Win 7
    C:\Users\%USERNAME%\AppData\Roaming\SQL Developer\systemXXXXXX
    Win XP
    documents and settings\%USERNAME%\Application Data\SQL Developer\systemXXXXXXMind you will lose all your other settings along with the layout, you may want to at least export your connections before trying.
    The layour file itself should be somthing called windowinglayout.xml located somewhere in the above config directory, but last time i checked deleting only this file had no effect.

  • Can I sort Comments by the order they appear on a page (i.e., top to bottom)?  Or can I only sort by page, but not within a page?

    I would like to be able to sort Comments not only by page, but also in the order they fall within a page.  For example, starting at the top of the page and working my way down so I am not jumping all over the page.  Is there such an option?

    Inspector > Document > Document Margins
    The word is border. Boarders are the Harry Potters of this world.
    Peter

  • How can i sort F4  by the data in the parameter  ?

    i create parameter "p_budat" .
    now i wont to display in the F4  just relevant data for  the user date .
    for example if the user enter "13.03.2006" ,
    just relevant data for this date will show up  .
    the problem is  , when i going to the  :
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_budat
    the parameter "p_budat" is empty the date that i enter is not there .
    also i want to use function  : F4_ZAHLLAUF
    is it possible to make sort there  ?

    hi,
    chk this sample code.
    <i>how to use dynamic f4 help?</i>
    tables: mara, makt.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab.
    data : begin of btab occurs 0,
    maktx like makt-maktx,
    end of btab.
    data mak like makt-maktx.
    DATA : return like ddshretval occurs 0 with header line.
    data: begin of dynpfields occurs 0.
    include structure dynpread.
    data: end of dynpfields.
    parameters: p_matnr like mara-matnr,
    p_maktx like makt-maktx.
    Initialization.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
    REFRESH ITAB.
    SELECT matnr FROM mara INTO TABLE ITAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'MATNR '
    dynprofield = 'P_MATNR '
    dynpprog = sy-REPID
    dynpnr = sy-dynnr
    value_org = 'S'
    TABLES
    value_tab = ITAB
    return_tab = return.
    select single maktx from makt into mak where matnr = return-fieldval.
    p_matnr = return-fieldval.
    refresh return.
    clear return.
    move 'P_MAKTX' to dynpfields-fieldname.
    move mak to dynpfields-fieldvalue.
    append dynpfields.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname               = sy-cprog
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          OTHERS               = 8.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    refresh return.
    clear return.
    Regards
    Anver

  • How can I attach files from the mac so pc can open them

    Hi, I am having trouble when I send a word document from my mac to other companies who are using PCs.  They seem to always come back saying they are unable to open them.  What can I do about this?

    For some attachments in Mac OS X Mail client just use the checkbox in the Attachment dialog "Windows friendly attachments."  You get that dialog, by clicking on the attach toolbar icon on the composition window.  If you don't have the attachment toolbar icon which looks like a paperclip, add it with View menu -> Customize toolbar when composing a message.
    Other e-mail programs such as Thunderbird, AOL, Webmail (any e-mail software that loads as part of a web browser) you have other attachment commands that support attachments which may or may not support Windows attachments.
    For others, you are at the mercy of the e-mail client of the PC user, and their installed supporting software for images etc, and their knowledge of how attachments are handled.  E-mail is not designed to handle formatted text and images universally the same way for each program.  It is better to learn how to compose a compatible website from http://www.anybrowser.org/ and just make a link to the website from your e-mail message.

  • How can i relink files to the timeline sequence when i've deleted the source file path? All the attribute are still in the timeline, I just can't relink

    So i started an edit and had the whole thing finished and ready to export in Final Cut X, when i went to export I had a message pop up say that it couldn't export while FCP X is still referencing media. I went through trying to solve the problem and ended up deleting the source media folders in the Final Cut Events folder and reimporting the clips. This lead to a whole can of worms opening up and now i'm left with a whole edit with 90% of the clips in the timeline unable to relink to source media.
    Can anyone help?

    First find the files. Then File>Relink Event Files and point to the folder.

Maybe you are looking for

  • Form ???

    I created a fillable PDF form, using Acrobat 9.  When I open it in Acrobat Reader XI I can fill in the fields, but as soon as I go to the next field, the text in the prior field disappears.  It is still there, but not visible until I click in this fi

  • Privileges to view packages in Sql Developer

    I'm sure this has been covered before, but I cannot view a package (spec or body) unless Execute has been granted. Create any procedure will allow spec/body to be displayed. Is this as intended? I searched the forum and elsewhere, and found comments

  • Discussion regarding un-unmountable external drives and more..

    I have a Mac OS Extended (Journaled) formatted LaCie 2TB external USB 2.0 hard drive which I use for backup and file storage with my MBP running snow leopard. Some times when working extremely large folders at work, I actually work right of the hard

  • Why can't I download movies when I've just increased my storage capacity?

    Tried downloading a movie rental but was told I need to increase storage capacity in local settings. I changed my plan to the max amnt (55GB) with 49 remaining. However, when I tried downloading a rental once again, the same thing happened.  I've tur

  • How do I get a pound sign on my key board?

    Hello I bought a mac book pro retina 2012 release date 12months old 2nd hand on ebay I cannot get a pound sign from the key board All the help on message boards says Alt/Option plus 3 should work.  Not for me it doesn't. I can't change it in system p