Get contents of unzipped folders

I receive multiple ZIP files at a time containing photos. I wrote a script or started to write one that does the following:
1. prompts to select the ZIP files
2. prompts to create a new folder
3. copies the ZIPs to the new folder
4. I then 'open' these ZIP files with StuffItExpander to unzip them into the new folder
I'm left with the original copy of the ZIP file and a new folder named after the ZIP file with the photos unzipped all in the same folder.
How can I then go into each one of the unzipped folders and copy/move the JPG files into yet a different folder? I will have to do it recursively methinks as there are multiple unzipped folders.
Baffling me.
TIA
Darren

OK, I played around with it some more, and think I got it right - I hope Leopard's Automator is better, because I sure found Tiger's frustrating (but then again, it is probably just me). The Automator actions seem to be a bit simplified, so I had to break them up into separate Shell Script and AppleScript actions. I don't know if the way is any "easier", but here they are (they are designed to be used together):
1) Paste the following into a Run Shell Script action (using the standard /bin/bash shell and passing the input as arguments):
<pre title="" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">for f in "$@"
do
# find regular files, no "dot" files, case insensitive, ending with ".jpg"
usr/bin/find "$f" -type f -not -name '.*' -and -iname '*.jpg'
done
</pre>
This Shell Script accepts Files/Folders from a Finder action such as "Ask for Finder Items", and uses find to output a list of matching items for the following AppleScript.
2) Paste the following into a Run AppleScript action:
<pre title="" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">on run {input, parameters} -- convert file paths from the "find" shell script
if input is not {""} then -- input is a list of POSIX files found
set TheResult to {}
repeat with AnItem in input
set the end of TheResult to (AnItem as POSIX file) as alias
end repeat
return TheResult -- output is a list of Finder aliases
else
display alert "Find error" message "No matching files found - workflow cancelled"
error number -128 -- user cancelled
end if
end run
</pre>
This AppleScript converts the POSIX files returned from the previous Shell Script to Finder aliases, which can be used in a FInder action such as "Copy Finder items".
The complete workflow (tested in OS X 10.4.11 Automator 1.0.5) is:
1) Ask for Finder items (type:folder, no multiple selections)
2) The above Run Shell Script action
3) The above Run AppleScript action
4) Copy Finder items (no replacing)
good luck

Similar Messages

  • My iPad shows using 4.1GB of storage for mail, even though I have delete all content in the folders. How do I get this storage back?

    My iPad shows using 4.1GB of storage for mail, even though I have deleted all content in the folders. How do I get this storage back?

    My iPad shows using 4.1GB of storage for mail, even though I have deleted all content in the folders. How do I get this storage back?

  • Finder gets stuck when reading contents of large folders on a SMB-share

    Hai thar, everyone. Recently I've found a sad bug in the world's most advanced OS. I wonder why it was left almost unnoticed as I was unable to find out some info on it so I created this topic in hope to turn attention to this issue when no solution is available right now by far. In short, bug consists in Finder's misbehaviour when it reads contents of big folders on a mounted SMB-shares like stated in the title. Number of files - somewhat around 11-12 thousands/folder. What't interesting, when one goes to the shared folder which contains not much files (below critical limit) - everything's just fine. When one opens a "bomb"-folder, Finder does nothing. It won't display folder's contents and moreover, it won't display contents of other folders on the share anymore, however, it's still able to show up contents of those folders you have visited just before opening "bomb"-folder. Probably it simply has  the contents of visited folders cached somewhere. The second consequence, connection to the SMB-share seems to degrade. Speed drops to miserable numbers and case you open some big file from the share theres a chance that it'll be loaded slowly. It's not that hot idea in fact, to load network by watching videos directly from the SMB-server =) but if you do open a movie, playback will be jerky as **** while it was perfect just before you poked the "bomb" and current traffic is very little - a few kbps/~100bps (according to Activity Monitor). As stated before, stuck Finder seemingly affects overall connection to the SMB-server in some strange manner. FS notifications get broken too, on the share.
    In general Finder proceeds functioning. It has no problems with local FS/other kinds of remote FS, but SMB. It looks like theres a stuck thread serving requests to for the file objects on the SMB-share which actually gets stuck or does extremelly slowly.
    The workaround is pretty simple and straight forward - you have to restructurize your "bomb"-folders by splitting them into several subfolders or such. Simply get rid of that huge heap of files stored in a single folder, fragment them and keep their number below 10k/folder. However, this is not a fix. It's only workaround. Fix should follow, as this issue is not only a "little inconvenience" but also a software flaw.
    This bug affects at least OS X 10.7.5 (11G63). Something similar was seen also on OS X 10.6.6
    WBR
    PS: sorry for my broken English.

    Reporting the same problem.
    1. Have Windows 7 MediaCenter with file sharing set up properly (LM+NTLM Authentication allowed and 128-bit encryption disabled in security policies).
    2. Test folder ("C:\income") and all the subfolders' owner is 'Guest', full access is granted for everyone.
    3. Connecting to MediaCenter from MacBook with Finder by pressing Cmd+K and typing smb://ip-addr/income
    4. Finder connects successfully, but some sub-folders and files are not being listed.
    Workaround:
    5. You can open a not-listed folder directly by pressing Cmd+K and typing smb://ip-addr/income/some-invisible-folder
    6. Voila! You're inside invisible folder.
    In the meantime, i can see all the sub-folders on a Windows XP client machine, so i can make a conclusion that all of these 'invisible' sub-folders are actually accessible by Finder, but in some reason are just not being listed on Mac.

  • How to Merge the Contents of Two Folders in Lion, Keeping the Newer Versions of Duplicate Files.

    Select and copy all the contents of the folder containing the newer files.  Paste the files ONTO the folder containing the older files.  The unique files will be copied into the older folder without further ado.  For the duplicates, a window will appear warning that a file with the same name already exists in the older folder.  Check the "Apply to All" box and click on the Replace button, not the Skip button.  These steps will merge all the files in the newer folder into the older folder, replacing the duplicates with the copies from the newer folder.
    Unfortunately, the only information that the warning window provides about the duplicates is their common name, not sizes, dates, or times.  These steps worked for me because I knew for certain that all the newer files were in one folder.

    Great, I just lost 10 GB of data thanks to OSX folder merge... because appaerantly I should have known better not to keep a subfolder inside my folder I was trying to merge
    I can not beleive more people don't have a problem with this. Merge contents in Lion does NOT merge contents if 1 or more of those supposed "contents" is a subfolder
    Merge contents of two folders only works for files, it does NOT work for subfolders!!!!
    Can we please get this acknowledged as a bug that needs fixing?
    EXAMPLE:
    Drive1 / Folder1
                   - text1.txt
                   - text2.txt
                   - / subfolder / text3.text
    MERGE TO
    Drive2 / Folder1
                   - text1.txt  (this gets updated / merged)
                   - text2.txt  (this gets updated / merged)
                   - / subfolder /
                             - text.txt
                             - text2.txt     (this should get text3.txt merged into it, from Drive1, but instead this subfolder is REPLACED, and NOT MERGED!!)
    Why would i want to replace a folder if I'm trying to merge it!?
    Almost 2013 and OSX still cant merge a folder? unbelievable

  • PS Get-Content - file containing environement variable

    Hello
    I have an issue with a script where I have a text file containing folders and files. I get them with Get-Content and then I copy them somewhere else.
    My problem is that I would like to be able to use environement variable in the text file, like D:\$env:USERNAME\Documents but when I get them through Get-Content, variable are not converted.
    Is there a way to make Powershell recognizing variables in the path ?
    Thanks !

    Invoke-Expression is not needed in this case. I recommend the $ExecutionContext.InvokeCommand.ExpandString method instead.
    -- Bill Stewart [Bill_Stewart]
    I'm open to suggestions, (even though what I suggested was demonstrated and works).
    I took your advice and tried your suggestion
    PS C:\Users\User>
    Add-Content C:\liste.txt 'D:\$env:USERNAME\Documents'
    Add-Content C:\liste.txt 'D:\Documents'
    $sourcelist = get-content C:\liste.txt | foreach-object {
    $ExecutionContext.InvokeCommand.ExpandString($_)
    There is no output? So I tried assigning it to a variable.
    PS C:\Users\User>
    Add-Content C:\liste.txt 'D:\$env:USERNAME\Documents'
    Add-Content C:\liste.txt 'D:\Documents'
    $sourcelist = get-content C:\liste.txt | foreach-object {
    $Path = $ExecutionContext.InvokeCommand.ExpandString($_)
    $Path
    LOL, there is still no output. 

  • I have a 120gb Classic that has no space left on it. i am going to buy a larger gb capacity ipod as soon as i get clearer instruction on how to get the old ipod content to the new ipod. How do you get content from one ipod to the other?

    how do you get content from one ipod to the new one? my content is on an external hard drive not on my pc and i have run out of space on my 120gb classic. can you get old ipod content to new? my itunes has only got short cuts, the real content is on an external drive? can this be done?? please help

    If the content is on an external drive, but your library knows where to find it, then it should all work. Connect your device, make some selections for what to put on it, and sync. If, on the other hand, your current iPod is the only place holding some of your media then see this user tip: Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I set up automatic downloads so that i only get content from specific devices?

    Hello! I was wondering if there was a way I could set up automatic downloads so I only get content purchased from certain devices. I have a MacBook Pro and a ipod touch. I share an apple id with my family for itunes but have my own apple id for icloud. In my family we have various other apple products (iphones and ipads) and I dont want most of the things that my family would download on their devices - just the things would happen to download on my ipod and computer.
    Thanks for the help,
    J

    jackson_7 wrote:
    Hello! I was wondering if there was a way I could set up automatic downloads so I only get content purchased from certain devices.........
    That's not possible sorry.

  • How do I get content from my iPad to show up on the tv screen using Apple TV without going thru iTunes?

    How can I get content from my iPad and my air book to show up on the tv screen using Apple TV, without going thru iTunes?

    You will need to use AirPlay to see that.
    Assuming both devices are on the same network and that AirPlay is not turned off on the Apple TV, then simply tap on the screen when you are watching content you wish to stream to your Apple TV, then tap the airplay icon that appears in the control bar, choose the Apple TV from the menu that appears.
    When displaying the content you wish to mirror on the iPad 2 (or better), iPad Mini, iPhone 4S (or better), double tap the home button (quickly) and swipe the bottom row of apps to the right to reveal the playback controls, tap the AirPlay icon and select your Apple TV from the list of available devices.

  • I have an Iphone 3Gs. I need to get contents of messages that were sent and received on the phone in June for evidence in court. I read online that the Iphone internal storage keeps all data done on phone in the storage. How do I get into it?

    I have an Iphone 36s. I need to get contents of messages that were sent on the phone in June of this year. I read online that the phone has an internal storage that keeps all data when phone is used and that this internal storage can be accessed. I need the contents of particular messages for evidence in court. How do I get into the internal storage? I've tried some of the methods that people post online, but none of them have been successful. Help!

    If you still have a backup from that point in time as part ofr your computer backup history, you could restore the backup folder, restore the phone from that backup and have the messages on the phone.
    More details about restoring from old backups can be found here: iPhone and iPod touch: About backups

  • This is the third time I have entered this question and answered with my PW, etc. I have updated my IPad with IOS 7, and updated Adobe Reader with ver. 11.3.1. I cannot get any files or folders to come up when I click on Adobe, even though my Usage indica

    I Have updated IPad to IOS 7.1.1, and also updated Adobe Reader to ver. 11.3.1. When I click on the Adobe icon, I get no files or folders to come up, just a blank screen. I know from my usage indicator on the IPad that I have 36 GB of PDF files resident, which I expected, but how do I access them. I had updated from IOS 5 because Adobe was crashing so often that it made it difficult to work.

    If restarting the app or your iPad/iPhone does not work, we are not aware of any other ways to fix this particular problem.  Uninstalling & reinstalling Adobe Reader may be the only option left.  It will clean up the "inconsistent" application data.  But it is not even guaranteed to fix the problem.
    If you uninstall Adobe Reader (or any other iOS apps), iOS will erase all of the application data including settings/preferences and PDF documents stored locally on your iPad/iPhone.
    We'd highly recommend backing up your PDF documents regularly (not just this time) so that you do not lose them when something goes wrong.
    How to backup and restore PDF documents on your iPad/iPhone using iTunes
    Backup your PDF documents.
    Uninstall Adobe Reader.
    Download and reinstall Adobe Reader from the App Store.
    Alternatively, you can store your PDF documents in cloud storage (e.g. Acrobat.com, Dropbox, Google Drive), which will eliminate the need to backup local files.
    Please let us know if you need further assistance.

  • Get-Content and add Date and Time in a new file

    Hello,
    in a existing file I have data like:
    1;Idle
    5;chrome
    1;spoolsv
    Now I need to grab the content and add date and time in front of each line and save it to another file like:
    07.04.2015;10:18;1;Idle
    07.04.2015;10:18;5;chrome
    07.04.2015;10:18;1;spoolsv
    But I don't have any idea how I could solve this challange. Does anyone have a helping hand for me?
    Greetings

    Hello,
    If you need a new file with the desired output try this
    get-content .\current.txt | Foreach-Object{ $dntv = (get-date) ; "$dntv" + $_} | Out-File newfile.txt
    regards,
    V
    Venu

  • I imported my email however out of all the folders in my inbox only a fraction of them ported into mozilla, how do I get all of the folders to port over?

    I should have 40 folders in my inbox but currently only 12 ported over, how do I get ALL of the folders to appear?

    Open Firefox -> Go to View -> Toolbars -> Chechmark on "Navigation Toolbar"
    this will bring back your address bar (where you type links to go to websites :P )

  • My last pc crashed, how do i get content from ipod/iphone/ipad and previously purchased items back into itunes on pc?

    How do I get content back into itunes from ipod/iphone and ipad when old pc died and now have a blank itunes?

    check out this post by Zevoneer.

  • When bookmarking a page, I can't get the complete list of bookmark folders to dropdown in order to select any folder in which to bookmark page. What do you set to get whole list of folders in Bookmarks to drop down?

    When bookmarking a page, I can't get the complete list of bookmark folders to drop down in order to select any folder in which to bookmark page. The 'Folder:' bar has 'Bookmarks Menu' showing. The arrow on the bar drops down 5 recent folders to which pages have been saved, but the pop down arrow to the right of the bar just opens to show the three categories and 'New Folder' button. What do you set to get whole list of folders in Bookmarks to drop down?

    To all, embarrassingly enough, I have discovered that I didn't know how to expand the three categories including 'Bookmarks Menu' in the 'Bookmark This Page' pop up interface. It was expanded by default on the initial Firefox opening and first page bookmark attempt. Next use it only showed categories. I clicked and double clicked the 'Bookmarks Menu' line, but failed to see the small, shaded triangle used to expand/collapse list. If it appears collapsed, just tap triangle at left of line to see all folders. It seems to open the same way after I do it for first time. Sorry for the inconvenience, and thanks for all the attempts to help.

  • I was moving bookmarks in safari and 2 complete folders have emptied their contents. The folders are still there. I don't have a working time machine and icloud has caused the relevant folders to disappear from all my machines, iPhone, iPad and iMac

    I was moving bookmarks in safari and 2 complete folders have emptied their contents. The folders are still there. I don't have a working time machine and icloud has caused the relevant folders to disappear from all my machines, iPhone, iPad and iMac as well as thge MacBook Air I was working on. HELP!!!

    Hi,
    There is NO need to put your whole questing in the "Questing Heather" therefore you can TYPE here. In the Text window as I did to.
    Now to your questing:
    So, you moved some Bookmarks and now 2 folders are completely empty.
    I think that they dropped in a other folder during dragging the Bookmarks.
    Did you check ALL of you Bookmark folder if they are there?
    If you didn't delete the they have to be still there.
    Dimaxum

Maybe you are looking for