Simple sorting program for folders/files

Hello comunity,
I would like to make a simple sorting program which will scan through some folder looking for files with different extensions. Then copy files of the same format (example *.pdf) and (create) place them into folder with the name of the extension. After that the program (script) should look for another extension and do the similar operation to them untill all files will be moved. I am new to applescript and automator.app, so could you please put me on the right direction which programmin (script) language should I use. Sample code and good tips would be usefull too. Thank you for your time.

This is not a hard thing to do. If you want to write it yourself, and have some background in programming, I recommend to read a book on AppleScript and start writing the code in AppleScript Editor.
The AppleScript Language Guide is a free reference book by Apple which you can download it. There are a lot of sample codes on the net too.
You should use the Finder dictionary to do this work. Finder is a scriptable application in Mac, which has a dictionary. This dictionary describes about the objects inside the finder that do all the duties of the Finder and you can call them directly in AppleScript to automate things. Open AppleScript editor, go to Window > Library and double click on Finder. This will open the dictionary. Note that all the objects in scriptable applications have a hierarchical relationship, starting from the root "application" object. You can read the dictionary to get familiar with the objects in the Finder app and know how to use them.
Here is some code:
tell application "Finder"
  tell the front window
  log (count of items of it)  -- prints the count of items in the window
  make new folder in it with properties {name:"mani"} -- makes a new folder named: mani
  make new file in it with properties {name:"test", extension:"txt"} -- makes a new text file
  repeat with x in every file in the items of it
      log the name of x
  end repeat
  end tell
end tell
If you can program in Objective-C and not have enough time to learn AppleScript, you can use Scripting Bridge technology to automate scriptable applications using Objective-C. This is so much better because enables you to debug your code or execute it line by line, which is not possible when working with AppleScript Editor.
Hope this helps

Similar Messages

  • A simple slideshow program for 68k OS7 Macs suggestions pls

    I'm looking for a simple slideshow program for my old 68k OS7 Macs. I just want to have some PICTs display on a set time period or key press. Nothing fancy.
    I can get Claris to this but wonder if HyperCard can. I'm no expert on HC but it seems to be designed for this exact job. Do I need to find a "stack" or some already made item to open in HC then attach my piks? Any suggestions?

    It would be possible to use HyperCard, although you may need to do a little programming if you go with it. If you use a blank HyperCard stack, you can assign one picture per card and link them. Clickable buttons would be the easiest way to do this. Which version of HyperCard are you using?
    An old version of PowerPoint would work fine too. Anything older than PowerPoint 98 runs on a 68K unless you are using a 68000 processor, in which case you'll need one of the pre-1994 versions.
    Believe it or not, Kid Pix is a possible answer to this as well. Any version from Kid Pix 2 onward (as well as the Kid Pix Companion addon for the original Broderbund version) contains an application called Slide Show, which is used with files in the PICT format. You can display an image for up to 30 seconds and add transitions between slides.

  • How do I make Pages the default program for .doc files?

    How do I make Pages the default program for .doc files without having the need to change the default program for each individual.doc file?

    Navigate to a .doc file.
    Ctrl click the file
    Choose Open with and then go down the list, past pages, to other
    Navigate to pages
    Before you click Open make sure you click the 'Always open with' check box.
    You should be okay.
    You can do a similar think by selecting the file, Choosing File-Get Info
    Then open the Open With Disclosure triangle.
    select pages and then click CHANGE ALL
    Hope this hleps.
    M.

  • Set pages to be default program for *.doc files

    Is it possible to set pages to be the default program which my computer will ALWAYS use to open a MS word document? In windows i could set default programs for specific file types, e.g. .jpg, .mpg, mp3. I did not have to assign a program to open the program every single time. As far as I can tell , I have had to request pages to open my word documents every time i open a word doc. for the first time. Although I can set pages to be the default program for that one file, i want it set to ALWAYS OPEN ALL WORD DOCS. , until further specified. Any suggestions?
    thx.

    Highlight a known Word document in the Finder, highlight it & choose Get Info from the File menu. In the Get Info box, click the triangle next to "Open With." Click on this drop-down menu & choose Pages. If Pages is not a choice, choose "Other" & navigate to the Pages application. Now click the "Change" button under the text that asks if you want to open all documents like this with Pages. You can then double-click the Word documents & they will open in Pages. Note that the icon for the Word files will have a plain, white icon.

  • Program for uploading file on application server...

    Hi,
    I have created a program to upload a file from presentation server (local desktop) to application server. But in this program I have to specify the file length. What should I do in given program so that I can upload file of any length on application server ?
    *& Report  Z_FILE_DOWNLOAD_TO_APP_SERVER                               *
    * This Program can be used to move flat files to application server from presentation server.
    REPORT  Z_FILE_DOWNLOAD_TO_APP_SERVER.
    PARAMETERS: P_FILE       LIKE IBIPPARMS-PATH,
               P_FILE1(20000) default 'E:CONVERSIONFLAT' lower case.
    DATA: WS_FILE TYPE STRING.
    DATA: BEGIN OF T_DATA OCCURS 0,
           RECORD(20000),
         END OF T_DATA.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
      FILE_NAME           = P_FILE
    START-OF-SELECTION.
    WS_FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
       FILENAME                      = WS_FILE
      FILETYPE                      = 'ASC'
    TABLES
       DATA_TAB                      = T_DATA
    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.
    * Creating the file at Appl server............................
    OPEN DATASET P_FILE1 FOR OUTPUT IN TEXT MODE encoding utf-8.
    if sy-subrc ne 0.
    message e000(--) with 'Error in opening file'.
    endif.
    * Trasfer the records to file.............
    loop at t_data.
    transfer t_data to p_file1.
    endloop.
    close dataset p_file1.
    if sy-subrc eq 0.
    write: / 'Written the files at ', p_file1.
    write:/ 'Goto AL11 Transaction and then click on SAP Directory DIR_SAPUSERS to look for the file'.
    endif.
    Please advice.
    Regards,
    Rajesh

    Try declaring it as TYPE STRING. Not sure though.
    There are two predefined types in ABAP with variable length:
    STRING for character strings
    XSTRING for byte strings
    Thanks,
    SKJ

  • Cannot set default programs for a file extension in Gnome

    After a gnome upgrade (cannot remember when), I can no longer set the default program for a particular file extension by right clicking the file in nautilus -> going to "properties" -> going to "open with" tab -> highlighting a program -> pressing "set as default".

    The program I was trying to set was totem for default video playback; wine had made windows media player the default player prior. Interestingly, once I installed gnome-mplayer; the default program changed to gnome-mplayer and I was then able to switch default programs. This error may be related to wine.
    Last edited by Bluerider (2013-07-05 23:07:59)

  • How to set default program for pdf files

    I was wondering if anyone knows how to change the default program for opening a file type. For example I would like to set Adobe Acrobat as my default program for opening pdf files instead of preview
    thanks

    Hi and Welcome to Apple Discussions
    Control-click a pdf file and choose "Get Info". In the Info window choose which application to open the file with and then click on the "change all" button. Voila!
    Matthew Whiting

  • Using a LabVIEW application as default program for opening files

    Google has returned nothing useful on this.  I want to use a built LabVIEW application to open data files from the Windows desktop. It is easy to edit the Windows registry to set the application as default program - but I'm not sure how to set the event in LabVIEW to open the file.  Any suggested reading?
    Solved!
    Go to Solution.

    I have done this before...I have a small LabVIEW .exe which looks at the version of a VI and selects the appropriate version of LabVIEW to open it with if available. It also adds explorer context menu items for allowing you pick a specific version of LabVIEW to open the file with.
    This is a rough idea of the registry keys for adding a program to handle specific file types and to add items to the shell menu in the installer:
    Add your own 'LabVIEWOpenWithVersion' key and then add the key name to the OpenWithProgids for the file extensions you want to be able to open with your application. The command part looks like this:
    Look at the Windows/MSDN help for what the different keys mean and how they are used, I think you can also set a key to make one of your handlers (e.g. Open, openWithLV) the default for the file type.
    For getting the file that was opened 'with' your application, use the App.Args property, ignoring the first item (which is always LabVIEW) in the array.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Program for DMEE file for Australia (Westpac Bank specified)

    Dear All,
    Request you to advice me the program that we needs to assign at the payment method to down load the payment medium file (DMEE) in the format of West pac Bank in Australia if any..
    I have a configuration requirement to down load the payment file from R3 ( after execution of F110 ) for the purpose of sending that to Westpac Bank (Australia) towards payments (Bank transfers) for vendors mentioned in that file. And for that I will have to create a new program to assign that in Payment Method so that we could able to down load the payment file in required format (Westpac). As i came to know that SAP provides various programs to fulfill the above requirement, Request you to let me know that program for Australia, so that i will use (Assign in Pmt Method) rather than creating new program.
    Thanks in advance,
    Gopi

    Hi,
    Please check the program .. "RFFOAU_T".
    Thanks,
    Jagannadh

  • Pages as default program for text files

    I don't want pages to be the default program for opening word files, how can I change it back to Text Editor?

    Select a document in the Finder, choose Get Info from the File menu, click on Open With, select the desired application, and press the Change All button.
    (85631)

  • Make lightroom default program for raw files

    I purchased Lightroom 5 after a trial version expired.  (I believe the version was 5.2, not sure.)  I got the actual DVD with the activation code on the box.
    Current OS is Windows 7.
    At first I ran the updates from the internet (had a bit of trouble with the DVD opening) and it loaded version 5.5, and I used the activation code.  Everything went well, but when I try to open a raw file (Sony/.arw extension), it doesn't give me the option to use Lightroom as the default program for this action.  It doesn't show the program at all, and when I go into browse and select it, it still won't come up.
    So, I uninstalled everything, rebooted etc, then loaded up the DVD and got the DVD to work this time.  Again, I think the version came up 5.2.  Went to assign .arw files to Lightroom, and - no problem whatsoever.  Lightroom showed up as a program, like it hadn't before.  I then ran the update again to 5.5, and I'm running into the exact same thing, where I can't set LR as the default program.  Possibly the registry is not right?  It's just no longer seeing Lightroom as a program in the "Open With" option (when I reinstalled, it wiped out the 'open with LR' I had attached to the files.)  I can open up Lightroom itself just fine, but I can't just click on a raw file and have it open.
    Any ideas on how to fix this, and why the earlier version was okay, but the update wiped out the 'open with' option?
    Thanks,
    Carmen

    It is common misconception that LR should open images.
    What happens is that LR opens LR catalogs, not images.  Images are imported after LR has started up.  You can double-click on a LR Catalog, an .lrcat, file, or you can drag-and-drop a LR catalog file onto the LR icon, and either will cause LR to open, but that is all.  If you ever opened an image with LR it would hang and be difficult to fix.
    I think maybe LR 1.x would automatically import images if you dragged them to it, but that was shut down several versions ago.
    LR can also be set to open when you insert a memory card, via a checkbox in preferences.
    You can also open LR via a shortcut, and then drag-and-drop a folder onto the main image area in Library mode and that'll initiate an import.  This is actually what I do for every import.

  • Setting default program for torrent files

    When I download a torrent file, I get the window that says 'You have chosen to open:...... which is: torrent File. What should Firefox to with this file?
    I can chose to save the file or Open With... and I browse to Tixati. However, the box that gives the option to do this automatically with files like this from now on is grayed out. Torrent files are not listed on the Applications in Options. This works fine in IE, but not in Firefox. What can I do?

    For further information, I made uTorrent my default torrent file and Firefox immediately gave the option of opening with uTorrent. As Tixati is a better program for this purpose with an increasing number of users, Firefox needs to enable default opening with Tixati.

  • What script to find associated program for a file type?

    Hi friends,
    I am looking for OSX commands that can do the following:
    - return name of associated program for a particular file type, i.e "QuickTime' for .mov
    - return path of the executable file of the program name returned above.
    I hope to get some ideas/suggestions from you.
    Thanks and have a nice day!

    Microsoft has a recover pst program that you can get from their
    site. But when I worked on a help desk and used the program, it might have worked about once out of 15 times. When I contacted Microsoft about it, they stated that they knew that the program really did not work and there was no rush on revising it. Saying
    that, we are talking about five years ago when I was on the help desk. Or use Outlook Restore Toolbox from  
    http://www.outlook.restoretools.com/
    http://www.filerepairforum.com/forum/microsoft/microsoft-aa/outlook/1168-does-anyone-have-any-ideas-for-solution-this-problem

  • Please Help! How do i make MS OFFICE the default programs for opening files

    Hey,
    Someone please tell me how to make MS OFFICE the default for opening up excel, word and pp files....Ever since i migrated all my stuff to my new 24in everything opens up in iwork instead of office, which is really annoying.
    Thanks in advance,
    JW

    Hi skymedic: Quite easy to set the default program actually. Find a file you need to open, single click. then Right Click and select "Get Info". When this window opens, select the program to be used then click "Change All'. Please note you will need to do this for all file types you want to open with Office. EG: .DOC .PPS .PPT .XLS etc..
    Good Luck
    Stedman

  • Program for storing files on application server

    Hi,
    I want to store my csv file on application sever can any one provide me the program for this

    Maya,
    there is no program per se for this ....
    you would need to maintain the directory structure in AL11 and then if required , you can have an FTP program to push the file into that directory. Also please specify your landscape  - are you on Windows / UNIX / AIX / SOLARIS... depending on that you would have to configure your FTP client...
    Arun
    Hope it helps...

Maybe you are looking for

  • Using SSO Session

    Hi, We are using AS 10.1.3.5 to deploy our EAR.(platfoem is OEL 5) In our EAR we are Hibernate 3.0 and Struts 2.0 Framework,using JDeveloper 10.1.3.5 and also we are using the SessionAware Interface of Struts 2 to implement session management. We hav

  • System preferences icons disappeared!

    My friend has a problem ... several icons from "System Preferences" simply disappeared one day. Now he doesn't have Accounts, Desktop & ScreenSaver and several others! Does anyone have any idea why this happened and how to solve it? Come on guys, he

  • Only one earphone works...earphones or iPod?

    I got my iPod nano 4GB 2nd generation a couple of months ago and for about a month the Right earphone has stopped working or only works after I fiddle with the jack for a few minutes and even then it only works for a few seconds or minutes if I'm luc

  • RFC Not found from the Third party system

    Dear Friends, I have customized a RFC, All components are active. When I am searching the RFC from third party system this RFC is not able to find, others are showing. What could be the reason..../ Thanks & Regards

  • Monitoring availability of SAP-WebDispatcher + ERP functions

    we want to check (Nagios) the availability of Webservices  components are SAP-WebDispatcher + ERP. in the past, after offline-backup and restarting the systems, there was a problem, when the webdispatcher first starts and the ERP-system was not allre