Automator put files in folders.?

I have a folder of movie files some within folders and some without folders, I would like to put the files without folders in a individual folder with the folder name corresponding to the movie filename is this possible to do in Automator?
Thanks in advance

You can get a couple of third party actions, or you can use a Run AppleScript action, for example:
1.  Ask for Finder Items { Type: files }
2.  Run AppleScript (replace the default with the following):
on run {input, parameters} -- create folders from file names and move
  set output to {} -- this will be a list of the moved files
  repeat with anItem in the input -- step through each item in the input
    set {theContainer, theName, theExtension} to (getTheNames from anItem)
    try
      set destination to (makeNewFolder for theName at theContainer) -- same location
      tell application "Finder"
        move anItem to destination
        set the end of the output to the result as alias -- success
      end tell
    on error errorMessage number errorNumber -- duplicate file name, permissions, etc
      log errorMessage & "  (" & errorNumber & ")"
      # handle errors if desired - just skip for now
    end try
  end repeat
  return the output -- pass on the results to following actions
end run
to getTheNames from someItem -- get a container, name, and extension from a file item
  tell application "System Events" to tell disk item (someItem as text)
    set theContainer to the path of the container
    set {theName, theExtension} to {name, name extension}
  end tell
  if theExtension is not "" then
    set theName to text 1 thru -((count theExtension) + 2) of theName -- just the name part
    set theExtension to "." & theExtension
  end if
  return {theContainer, theName, theExtension}
end getTheNames
to makeNewFolder for theChild at theParent -- make a new child folder at the parent location if it doesn't already exist
  set theParent to theParent as text
  if theParent begins with "/" then set theParent to theParent as POSIX file as text
  try
    return (theParent & theChild) as alias
  on error -- no folder
    tell application "Finder" to make new folder at theParent with properties {name:theChild}
    return the result as alias
  end try
end makeNewFolder

Similar Messages

  • Cannot put files into folders

    I cannot put files into folders after the update. The app crashes dramatically. Please fixed it otherwise it is useless.

    Hi,
    We are aware of the issue and are currently working on fixing the same.
    Thanks,
    Ankit
    Adobe Reader Team

  • Putting files from folders puts them up in corner,  Lion

    If I open a folder and remove a file to place it somewhere on my desktop, it immediately flies up to the top right corner of my screen, half-way out of view.
    It took me awhile to even discover that's where they went and I kept having to open them with Spotlight.
    Once I delicately pick the file out of the corner with my pointer I can place it wherever I want on the desktop.
    This happens whether I'm using hotcorners or not, no matter what view.
    Anybody else dealing with this? Only since installing Lion...
    Thanks any and everyone!

    Details please
    What version of iPhoto and of the OS?
    i tried to rebuild my files from folders that had the pics in them.
    Exactly what did you do and how did you do it? this ay be the cause of your issue but without details we can n=ony guess
    my iphoto only shows  only shows thumb size pics when I try to open them,
    where do you see htis? In the iPhoto window? what does "try to pen them" exactly mean?
    originally all the photos had a large delta with a question mark.
    Ok - this usually has a simple solution - do you still have a copy of the library that has this problem?
    also I can't back up the library file because its not there.
    This makes no sense at all - all of your previous statements indicate that you do have an iPhoto library but have some problems with it
    By default your iPHoto library is located in your Pictures folder and is named iPhtoo library - if tha tis not the case the you have moved or renamed it and only you know what you did until you tell us the details
    I went to time machune and tried to find the file but I can't find it or I am looking in the wrong place.
    Again unless you actually share what and how you are doing thing but continue to simply state abstract problems it is no possible to assist you - details on using Time Machine are here  --  http://support.apple.com/kb/HT1427?viewlocale=en_US&locale=en_US   --     and   --    http://pondini.org/TM/FAQ.html   ---
    I also lost my Idvd file, only have broken chain showing.
    This would be better addressed in the iDVD forum - but again unlesss yu share detailed information no one can assist
    LN

  • Need advice. Is it necessary to put images in folders and subfolders with LR?

    It seems that the concept of spending hours putting files into folders, sub-folders and sub-sub-folders is not needed  with LR. Creating all these folders takes hours, especially if you are like me and need a major reorganization of image organization. My thought is that all images can go into one massive folder as long as they are properly tagged. I can then use LR Smart Collections to essentially virtually organize all my images. I can create many more sorting options using Smart Collections than I can by putting images into a folder. This flies in the face of everything I've learned about storing data on a computer so I'm nervouse to head this direction because it starts with unorganizing my folders and removing all tags so I can start fresh.
    I don't want to take this on only to learn I didn't think of a gotcha issue. One drawback is that you are now committed to find anything by using LR or tags only. What do you think?

    Lee Jay wrote:
    Okay, then be honest.  What would you do if you were me?....So - give me an honest recommendation on a go-forward path (no "coulda, woulda, shoulda's").
    Honestly, I always start off from assessing what you really need or what value you could get from keywording. I wouldn't advise you to add keywords for their own sake.
    Lee Jay wrote:
    Meanwhile, I can already find all my images efficiently in seconds in nearly all cases.  I estimate that there is about one situation per year where having a comprehensively keyworded image store would be helpful in saving me time - perhaps 15 minutes each time that happens.
    Let's pretend that this isn't quite as black and white as you always put it. Let's say we're mainly talking weddings - typically wedding photographers add few keywords, if any. And let's say you do need to find certain images more often - each time you go to meet prospective clients you want to put on your iPad (you?) a portfolio of your best work for their broad type of wedding. So you might have categories like indoors / outdoors / subaqua, particular venues, age groups, religions through humanist,  formal / weird. Let's assume you do judge it worthwhile to increase the number of keywords.
    Lee Jay wrote:
    I could start tagging images now as I collect them.  But then I'd have all those other images that aren't tagged and all the new ones that are.  That means using the smart-collection approach would mean all the new ones were in neat collections, and all the old ones were in a gigantic "untagged" collection with over 100,000 images in it.
    Actually, that is the way I would advise you to go. Don't let the perfect be the enemy of the possible. It's not at all uncommon that people are put off beginning doing some keywording by the scale of the complete task. But beginning with the images that you're currently working on isn't too much extra effort. Even if it turns out that you never eventually do go back and keyword the old stuff, in a year's time you'll have a whole year's worth tagged. While doing so you'll probably adopt ways to make keywording less of a chore. For example you might add metadata presets to slap on overall keywords for the typical shoot "Wedding, Ceremonies, Christian" and then one or more keyword sets if you can justify putting time into varying the keywords between images - eg Bride, Kids, Cake. I wouldn't waste any time building up a hierarchy (do if you want, or not if you don't).
    I simply wouldn't worry about the 100,000 remaining untagged - they'll be easier to tackle once you're you've got the experience / benefits from keywording new stuff. I'd advise you to do it only as and when you need - it's too big a task to do anything else. Let's say you need your best shots of Jewish weddings and - as you're currently keeping a lot of metadata in your head - you know some are in that untagged mass. Find them through the folder system as you do now, whack on some keywords like "Wedding, Jewish, Non-orthodox". All those shots are of the bride - whack on "Bride" (maybe from a keyword set). Hey, she's got an obvious tattoo - let's just add that keyword just in case it'll be useful. And quickly move on. Whatever seems worthwhile.
    Although scripting could help, where's the script? Worthwhile to write/adapt one yourself? Instead for folder names I'd just just smart collections to gather image - eg folder name contains "weddings" - and then slap on the keywords. Sure, there will be some duplication between the pseudo-metadata in the folder names and in keywords, but duplication happens with metadata. In fact, it'll be quicker to search by the keyword "Wedding" than search for images with the keyword "Wedding" and / or with the folder name containing "Wedding".
    So that's how I'd advise you - start with the new work, and deal with the older stuff ad hoc.
    John

  • Using Applescript and Automator to manage files and folders

    Hi all.
    I need to make a simple action via applescript and-or automator to take the file it's been applied to (via the services) create a folder around it with the same name as the file.
    So far, I've searched the web, found some solutions but none are really working.
    Here's the script I found :
    set myFolder to findFolder()
    tell application "Finder" to set myFiles to files of myFolder as alias list
    repeat with aFile in myFiles
      set bName to my baseName(aFile)
      tell application "Finder"
      set folderExists to exists folder bName of myFolder
      if not folderExists then make new folder at myFolder with properties {name:bName}
      move aFile to folder bName of myFolder
      end tell
    end repeat
    ---------------- HANDLERS ----------------
    on baseName(myFile)
      tell application "System Events" to set {fileName, fileExt} to {name, name extension} of myFile
      return text 1 thru ((get offset of "." & fileExt in fileName) - 1) of fileName
    end baseName
    on findFolder()
      activate application "SystemUIServer"
      -- Bug pointed out by Lauri Ranta http://www.openradar.me/9406282
      tell application "Finder"
      activate
      set mySelection to (get selection)
      if mySelection ≠ {} then
      set mySelection to first item of (get selection)
      if mySelection's class = folder then
      set currentFolder to mySelection
      else if mySelection's class = document file then
      set currentFolder to parent of mySelection
      else if mySelection's class = alias file then
      set currentFolder to original item of mySelection
      end if
      else
      set currentFolder to target of front Finder window
      end if
      end tell
      return (currentFolder as alias)
    end findFolder
    And here's a page where they explain how to use automator and the Services to do what I <allmost> want, with some adaptation.
    But it still doesn't work.
    http://hbase.net/2011/08/17/move-selected-files-into-a-new-folder-using-applescr ipt-and-automator/
    So if anybody has an idea n how I could do this ?
    It It could either be a folder action (I drag and drop the files into a folder and boom, they get their folder around them)that I would set on a folder on a network drive, or locally, it doesn't matter, or a service (right clic on the file and boom folder around it.
    So if anyone could help with this I'd be grateful...

    Hi,
    Make an Automator Service (Service receives selected "Files or Folders"  in the "Finder.app").
    Use this script in the "Run AppleScript" action:
    on run {input, parameters}
        tell application "Finder"
            repeat with aFile in input
                if class of (item aFile) is not folder then
                    set {tName, fileExt} to {name, name extension} of aFile
                    if fileExt is not missing value and fileExt is not "" then
                        set tName to text 1 thru -((count fileExt) + 2) of tName
                        tell (get container of aFile)
                            if not (exists folder tName) then make new folder at it with properties {name:tName}
                            move aFile to folder tName
                        end tell
                    end if
                end if
            end repeat
        end tell
    end run
    This script work on files with a name extension.

  • Putting files/folders onto ipad

    Hey I'm pretty new to using the iPad. So here's my question. I like to read comics/manga on my Samsung phone but would like to use those files/folders on my iPad.
    Is there a way to put these files and folders directly there seeing as iTunes doesn't seem to upload zip files.
    Also I'd like to organise these files into folders thus the folders part of the question.
    I've tried using file transfer apps but they don't seem to upload whole folders, instead it's individually.

    Is this what you're looking for ?
    iZip.com on the App Store on iTunes
    https://itunes.apple.com/us/app/izip.com/id461682040?mt=8
    Mar 2, 2012 - Read reviews, get customer ratings, see screenshots, and learn more about iZip. com on the App Store. Download iZip.com and enjoy it on your ...

  • I am connected to my remote server and "put files" but the web page files do not update, whats going on?

    I really can't figure this out:
    So I use a different computer at school for web design, I bought Dreamweaver to work on it at home, I get the files fine from the server that I uploaded at school but then I make changes at home computer and connect and "put" them and I check online and the web page doesn't change one bit.
    I don't have the exact file extensions from the computer at school but when I connect and get I have a similar folder(s) set up and then it downloads them into Dreamweaver file manager box and makes the folders there I downloaded. The site shows up fine in Dreamweaver after I "get" so great I thinking.
    But... not so fast, I change the page in Dreamweaver, preview n a browser and look right on so I "put", connect to server and upload. Then I check online an its still the same I uploaded the CSS and HTML and dependent files by dragging over and also using the up arrow "put" as well but nothing changes on the web page online.
    What is happening here I am so confused?
    Thanks a bunch, I mean I can still preview as I go but I really curious why my "put" files don't change my web page like at all!

    Have you tried refreshing the browser, or deleting the browser cache?

  • I have 2 auxillary disk drives for my MacBokk Pro. Time Machine uses one for backup and I use the other for storage, but I am unable to create a new folder or drag and drop files or folders to the aux drive.

    I am unable to create a new folder on either of my auxillary disk drives.  I can access the files and folders that were there when I transferred one of the drives from a PC.  Time machine uses one for backup and I want to use the other to store photos which are large files.  An help would be appreciated.

    Thanks for the reply.  If I reformat the drive will I be able to access the files on it from the MAC.  I do not share the drive with a PC.  The files were originally created on a PC which I no longer use.  I do want to continue to access the files put there by the PC.  I would like to not have to copy them over to the MAC hard drive just to use them.  The second aux drive is new and works fine because it was formatted by the MAC.  I can drag and drop files there and work with just as if they were on the internal drive.

  • I took the system file out of the system folder on os 9.2 can't boot to put file back in machine also has osx 10.2 but won't let me boot to either need os 9 compatible boot disk I think?

    I took the system file out of the system folder on os 9.2 can't boot to put file back in machine also has osx 10.2 but won't let me boot to either need os 9 compatible boot disk I think?

    If the OS X 10.2 on the hard drive is/was bootable, try this -
    Restart or boot, then immediately press the X key, keep it held down until you know the machine has started to boot using OS X. This is a hardware instruction to the Mac to boot using the first usable instance of OS X it finds.
    Once booted to OS X, you should be able to move OS 9's System file into OS 9's System Folder.
    Note - in general, unless you know for sure what you are doing and that the results are desired, do not relocate or rename files in OS 9's System Folder or in OS X's System or Library folders.

  • Can't sort files and folders

    Two questions:
    1. In a folder I want to sort the items in order allways folders first and second files by namne but sometimes the folders last. Is it any way to solve this? The Mac mixed sorting makes me mad.
    2. When in Finder-menu View the choice Clean Up and Arrange by is grey and can't be used. How come? Is it possible to make these choices active?
    Svante

    It's always frustrating when the designers didn't think to do it 'your' way. But we all figured out how to drive cars that were built 'their' way and we can do this too. The fact that MicroSoft did it another way, just is not relevant to working with your Mac. We're still coping with sillyunderscoresover here, and now our apps quit on us when we close their windows.
    You like a hierarchy that puts folders before individual file items: Make a folder, call it "Directories" (or even better " Directories", or "•Folders"), put all your folders in that window into it, and if you want, make a companion "Documents" folder for everything else. Click the flippy triangles of both to reveal their contents. There, everything in list order, folders first. You will have to do a teensy bit of handfiling you're not used to, but as others mentioned a simple naming convention would have spared you that (and this suggestion). If you truly hate the look, you can make invisible custom icons for the two folders and use a style like:"••••••Folders•••••", "-----Files----" so they look like headers.
    People have complained about missing this Windows 'feature' before without ever convincing me of its virtue. I can see which items are folders and don't need them artificially at the top (Sort by kind does that if ever I do) and find the integrated alphanumeric list useful for grouping unfiled documents near their folders. When I want the first item(s) on the list to be a folder, I so name it. You can cope, just like you can learn to navigate a new subdivision with all the cul-de-sacs. Now if I could just get used to this silly idea North Americans have that we should drive on the right.
    Message was edited by: Ed Hanna
    Message was edited by: Ed Hanna

  • Can't sort files and folders. Sorry doubble mailed

    Two questions:
    1. In a folder I want to sort the items in order allways folders first and second files by namne but sometimes the folders last. Is it any way to solve this? The Mac mixed sorting makes me mad.
    2. When in Finder-menu View the choice Clean Up and Arrange by is grey and can't be used. How come? Is it possible to make these choices active?
    Svante
    Message was edited by: Svante

    It's always frustrating when the designers didn't think to do it 'your' way. But we all figured out how to drive cars that were built 'their' way and we can do this too. The fact that MicroSoft did it another way, just is not relevant to working with your Mac. We're still coping with sillyunderscoresover here, and now our apps quit on us when we close their windows.
    You like a hierarchy that puts folders before individual file items: Make a folder, call it "Directories" (or even better " Directories", or "•Folders"), put all your folders in that window into it, and if you want, make a companion "Documents" folder for everything else. Click the flippy triangles of both to reveal their contents. There, everything in list order, folders first. You will have to do a teensy bit of handfiling you're not used to, but as others mentioned a simple naming convention would have spared you that (and this suggestion). If you truly hate the look, you can make invisible custom icons for the two folders and use a style like:"••••••Folders•••••", "-----Files----" so they look like headers.
    People have complained about missing this Windows 'feature' before without ever convincing me of its virtue. I can see which items are folders and don't need them artificially at the top (Sort by kind does that if ever I do) and find the integrated alphanumeric list useful for grouping unfiled documents near their folders. When I want the first item(s) on the list to be a folder, I so name it. You can cope, just like you can learn to navigate a new subdivision with all the cul-de-sacs. Now if I could just get used to this silly idea North Americans have that we should drive on the right.
    Message was edited by: Ed Hanna
    Message was edited by: Ed Hanna

  • How do i organise my files into folders in iCloud. If i can't this clearly isn't a replacement for MM and idisk

    Hey
    Does anyone know the deal with the documents in icloud. I used to have many different folders with documents in idisk. I need to seperate my files into folders. How can this replace i disk????

    I agree - my early days with iCloud are disappointing, particularly since it seems to (extraordinarily) have fewer mail rules than the Mac.
    For file sharing I have gone along a different route.  Have a look at http://www.evernote.com/  I share any information I might want to see or use on my iPad and iPhone when away from my Mac on Evernote - tax forms, essential documents, pdf files, recipes...  I have put them on the evernote 'cloud' (though you could choose to have copies on your devices) and can use Pages, Numbers, pdf readers etc.  Basically you can put pretty well anything into a 'note' and store your notes in 'notebooks'.
    I am as pleased with Evernote as I am not with iCloud. It is so sad, I have used Apple kit since 1985.  I still love it and wouldn't dream of buying a Windows machine, but I feel that the software development guys are losing touch with those of us who don't just want to surf the web and take photos.
    ps It took me a day or two to grasp the structural concepts of Evernote.  Well worth perservering.

  • I am having trouble deleting files and folders after creating in the same .VI

    I have a larger .VI that runs an automated balancing routine for a large rotating mass.  The test needs to create some folders and files so that as the rest is run multiple times, there is a way to track how units did under test and when they were tested.
    The attached .VI is only the portion of the code that creates the files and folders, waits for user input, and then deletes them if the test is cancelled before data is collected.  There are other elements, but they are irrelevant given that I can't even get the stripped down code to work.  I have checked the permissions on the deepest file (within both folders) and I am unable to get 777(oct) permissions on this file which could be the only problem I have.  Does anyone have any suggestions?
    Attachments:
    test1.vi ‏47 KB

    Here are a couple of things:
    Frame 0: the pane properties are saved with the file, so once they are set you never need to set them again. Delete the property node and associated constants.
    Frame 1:
    Shouldn't "Serial#" be a control (and an integer)? You do a complex song and dance to add leading zeroes. Simply format your serial number with format "%04d"
    Shouldn't "Operator" be a control?
    Frame 2: That loop needs a small wait statement. Since STOP is always true when the loop ends, the later case structure seems unneeded.
    Frame 3:
    the STOP function seems unneeded. the VI will stop anyway since there is no code left.
    never use default tunnels for references.
    All your error outputs are "disconnected" and write to the same indicator. Mist likely you'll loose intermediary errors.
    Overall, you should use a state machine architecture instead of sequences. It will be much more flexible and will take even less diagram space. The indicators can be outside the state case, so all states can write to them. No locals needed.
    LabVIEW Champion . Do more with less code and in less time .

  • Network-- being able to put files on another computer

    Hi
    I can acquire the computer over our network and take files off the computer in question but I want to be able to put files on the computer. It is acting as a storage computer. We are within a firewall.
    What do I need to do? I am the administrator.

    Hi Portendder,
    Some of our teachers use Nearpod to share presentations on student iPads. Might work for you too...
    You could also share files or folders with your board of directors using a cloud service like Dropbox or Google Drive.
    Hope this helps!
    ~Joe

  • Replace all references to files and folders with lowercase in web documents on a site

    Hi I'm working on a test server that runs Ubuntu Unix (but my PC which has Dreamweaver CC is running Windows 8.1). I would like to search and replace in Dreamweaver to change all src and href attribute values inside files (webpages, css, etc.) on my site to lowercase, but with the folder and file names' spelling otherwise unchanged. I already changed the names of the actual files and folders, but wanted to make all references in my files point to them again. I started to use regular expressions in the specific tag search, but I was not sure how to specify letter case conversion on a backtracked value. Some flavors of RegEx allow you to replace a searched value in parentheses with its lowercase counterpart by specifying something like this: \L\1
    Where \L converts the character captured in the reference \1 to lowercase. Thanks.

    Hi Jon,
    Thanks for your response. Yes, I tried. But I’m not sure you can use any RegEx special characters in the replacement text. I put in \L0 and it just replaced the match with the literal string, so href=”Support/Index.HTML” became href=”\L0”
    What I want is href=”support/index.html”
    The reason I didn’t use Dreamweaver to change the actual file and folder names is I have images widely dispersed in subfolders. I didn’t think Dreamweaver would automate that part—I think you can only select a file individually to rename it, and then DW will correct all references to it. But probably can’t rename everything with one command from the root. Well, this is turning out harder than I thought.
    Let me know if you have any other ideas.
    Thanks,
    Dave.

Maybe you are looking for

  • Can't sync music after 6.1.3 update

    No matter what mish-mash of settings I try, I can no longer sync my iTunes music to my phone. If I look at the music on my phone via iTunes, it's all greyed out. Nothing in these forums works, I've read at least 100 pages. Please help!

  • URGENT Bridge and cache error photo corrupted NEED HELP

    We were going to edit a photo and upon opening it and error came up and said: "edit bridge encountered a problem and is unable to read the cache. please try purging the central cache in cache peferences to correct situation" We solved the cache probl

  • GRC 10 Add on installation -Access control node missing in IMG SPRO

    Dear Experts We have got GRC 10 addon install on our server by basis team and i can verify that by going to saint t code but when i am going to SPRO i cannot see aplication by name GRC .Where as i can see GRC Process control and GRC risk management ,

  • Passing of ResultSet to Stored Procedure(Oracle 8i)  from Java

    My requirement is such that I want to send a resultset to a stored procedure(In oracle8i). Through Java API's. The input parameter to the PLSQL is a ref cursor. I am trying to send the resultSet using CallableStatement of java but it is throwing an I

  • One Time Only charges in SD-SA and Sales Orders

    Hi, We have a requirement to provide a header surcharge condition in sales order / scheduling agreement for one time only charges. This basically required to throw a lump sum charge on order and charge the customer. User would enter the pricing condi