Using Automator to "cat" files

Hi all-
I was wondering if someone could help me with an Automator workflow. I've never used Automator... but I'm pretty sure it can do what I'm looking for.
I need it to "cat" .MTS (AVCHD) files for me. I'd like it to order them alphabetically, then cat and output to a single file.
Is this possible?
Thanks!

Yea, I figured out that much. My end goal is to take two .MTS (video) files and drop them onto an automator app and have it cat the files. I just don't know how to get there.
I'm not good with scripting, and I've never written an Applescirpt, but I know I'm missing something here. Just having the "cat" command in the "Run Shell Script" action isn't working. I'm thinking I have to specify somehow for it to "use the two files I just gave you and run the cat command on them, then output".
Does that make sense?
Here is what I have so far in Automator:
1. App recieves files or folders as input
2. Sort Finder Items   
     -by Name in Ascending order
3. Run Shell Script
     -cat
4. Move Finder Items
     -to Desktop.
Thanks!

Similar Messages

  • Use Automator to move files and folder structure to another folder, retaining destination contents

    I have been struggling trying to setup Automator to move files and folder structure to another folder, retaining the destination contents.  Basically, I need to add files at the destination, within the same folder structure that exists at the source.  Here's some details about the scenario:
    -I have PDF files that I create on a seperate computer than I my daily use machine
    -For security reasons, the source computer doesn't have access to any shares on the destination computer
    -The destination computer has access to shares on the source computer
    -I want to delete the original PDFs at the source after they are moved or copied
    I haven't been able to get Automator to move or copy the folder contents (files and subfolders) without dropping everything copied at the top level of the destination, resulting in many duplicate folders and a broken folder structure.
    So far I've only had luck getting this to work at the command line, but I'd really like to have this setup in Automator so that I could have either a service or application that I could use for any folder, prompting for the source and destination folders.  I'm a relatively new Mac user with limited Linux experience, so this is the command that I've cobbled together and currently accomplishes what I'm looking for:
    ditto /Volumes/SMB_Temp/SOURCE ~/Desktop/Documents/DESTINATION
    cd /Volumes/SMB_Temp/SOURCE
    find . -type f -name "*.pdf" -exec rm -f {} \;
    Thanks for any ideas!

    If you have a command-line syntax that works, why not just create an Automator workflow with a single 'Utilities -> Run Shell Script' action, where that action has your (working) shell commands?
    Seems way, way simpler to me than trying to reinvent the wheel and transcribe shell commands into individual Automator actions

  • How to use automator to duplicate files into separate folder?

    i am running the latest version of Yosemite just to clarify.
    My question is, is it possible to use automator to automatically copy a file thats added to a folder to a separate folder?
    to clarify, i have a drive account that has all my university work stored in a folder called university, i also have a folder on my HD called university.
    When i work on something i open it from the university folder on my HD, and when im done working i have to copy the file manually into the drive folder.
    Is there any way that i can use automator to detect when a file gets saved in a folder on my hard drive and automatically copy it to my drive folder?

    Hello,
    I really don't have much of an idea, but since no one has replied yet, I'll offer this...
    I wonder if it's a matter of having to clear browser caches & reloading the page?

  • Using automator to delete files with out moving them to the trash

    My boss and I work for a school district and we have been fight the ever losing battle of keeping kids from using usb drives and ipods on the computers. We have it fixed on the server accounts so they can't. But the local accounts they can do as they please. So we have found the files that we need to remove Example ( IOUSBMassStorageClass.kext, IPodDriver.kext, ITunesPhoneDriver.kext ) I have tried to use automator to delete these files by creating an application. Well it can't remove them because its need sudo access. So no im trying to figure out how to create a apple script to do so. I know once the files are removed the machines needs to restarted. So im not sure how to include a restart command too.
    Any help on how to get this working would greatly appreciated. We have over a 600 machines to do this to. I know that there maybe mixed feeling about removing these functions but we have to fallow our board digital computer policy Primarily ever since the RIAA has been cracking down.

    Hi Northridge, and a warm welcome to the forums!
    I'd use the Terminal...
    In Terminal type man mv & man reboot
    You can execute those commands preceded by sudo, like...
    sudo mv /Library/Extensions/IOUSBMassStorageClass.kext /Library/Extensions/IOUSBMassStorageClass.kext.old
    This one just renames it, but you could move it wherever you want.

  • Using Automator for photography file needs

    I've been looking on here but can't find a way to do what I need done exactly.
    I shoot in both raw and jpeg and I want to be able to run one action on a folder to do the following.
    Arrange the files in a folder by name and in ascending order.
    Create 2 folders in the input folder. 1 called RAW and copy all the raw files (.nef) to that folder and the other called JPEG and copy all the jpeg files to that folder.
    Rename the files fro _dsc4356.jpg to macshoot0001.jpg and in the raw folder rename all the files as well.
    Is this possible using the automator?
    Thanks.

    Hi,
    In Automator :
    add action "*Run Shell Script*"
    Select "/bin/bash" in Shell popup menu
    Select "*as arguments*" in pass input: popup menu
    Paste this text in the action.
    baseName="macshoot"
    padding=0000 ## 3 zero pad
    for f in "$@"; do
    if [ -d "$f" ]; then ## is a directory
    i=0
    cd "$f"; /bin/mkdir -p "$f"/{RAW,JPEG}
    for aJPG in "$f/"*.jpg ; do
    if [ -f "$aJPG" ]; then
    ((i++)); index=${padding:${#i}}$i;
    /bin/mv "$aJPG" "JPEG/$baseName$index.jpg"
    fi
    done
    i=0
    for aNEF in "$f/"*.nef ; do
    if [ -f "$aNEF" ]; then
    ((i++)); index=${padding:${#i}}$i;
    /bin/mv "$aNEF" "RAW/$baseName$index.nef"
    fi
    done
    fi
    done
    That's all.
    This shell proceed folder(s) only, if the input is file(s), it do nothing
    Message was edited by: Jacques Rioux

  • Use Automator to move files to trash

    I've spent quite a bit of time trying to work out how to move files with automator to another folder - finally worked this out using a folder action.
    I am now trying to do similar, but this time using a folder action to move files to the trash.  Again, I don't seem to be getting this right.  I have the following:
    There are definitely files in the folder that meet the criteria - but the workflow is not working.  Any suggestions, please?
    Cheers,
    Mike

    sdiaz34 wrote:
    The external hard drive was partitioned to have a back up drive for time machine and another drive for other (pics&vids) use.
    If it is possible can the automator task then trash all files in original pictures subfolder when task is complete to avoid any memory use on macbook air?
    You really don't want to do that. 
    You'll have only one copy of the files, on the external HD.  When (not if) it fails, they'll be lost.  
    For best results, get another external HD for your photos.  Then let Time Machine back up both your internal HD and the external.  See Time Machine - Frequently Asked Question #32 for details.

  • I was wondering if it was possible to use Automator to move files based on the filename.

    Hi,
    I'm kind of new to Automator and I'm trying to come up with a sequence that will severely save me a few hours a day moving files from two larger folders into smaller folders. Basically the setup is that I have two folders, one constantly being populated with images and the other with video files. They each have file names starting with a two digit number (i.e. 12, 11, 10...) or "BG" and then a two digit number (i.e. BG12, BG11, BG10...) with the digits corresponding to a year. Essentially, I'd need to move the files into folders corresponding to the year (i.e. files starting with BG12 and 12 would be moved to 2012, files starting with BG11 and 11 would be moved to 2011, etc). As it stands now, I've only been able to get the 2012 folder populated. Any help would be greatly appreciated. Thanks.

    Hi,
    Here's a solution that uses a script, because it is not possible, at least to make twenty or more Workflows
    In Automator :
    Create a new worflow.
    Add the action "Run Shell Script", select "/bin/bash" in the popup menu
    Cut the text in the action.
    Copy/paste this script in the action :
    targetsDir=('/Users/jack/Desktop/MyImagesFolder' '/Users/jack/Desktop/MyVideosFolder')
    destDir=('/Users/jack/Desktop/yearImageFolder' '/Users/jack/Desktop/yearVideoFolder')
    for i in 0 1;do
          subfolder="${destDir[$i]}"/20
          for each in "${targetsDir[$i]}"/*;do
                if [ ! -d "$each" ];then ## not a directory
                      name=${each##*/};
                      if [[ $name =~ ^([0-9]{2})|^..([0-9]{2}) ]]; then
                            [[ $name =~ ([0-9]{2}) ]] && year=${BASH_REMATCH[1]};
                            /bin/mv -n "$each" "$subfolder$year"
                      fi
                fi
          done
    done
    Replace the paths in the first line by the path of your Images Folder  and Video Folder, use drag/drop between the simple quote ''
    Replace the paths in the second line by the path of your destibation Folders, use drag/drop between the simple quote ''.
    This script will not overwrite existing files, If you want to replace the existing file, use the /bin/mv -f instead of /bin/mv -n
    That's it.

  • How can i use automator to rename files erasing first 3 digits of their name?

    Actually in the files i am trying to rename the first 2 digits are numbers then space and then there is the file name i want to use. Hope this helps.

    Open the AppleScript Editor in the /Applications/Utilities/ folder and paste in the following text:
    tell application "Finder"
    set the_items to items of window 1
    repeat with this_item in the_items
    set name of this_item to (items 4 thru -1 of (get name of this_item)) as string
    end repeat
    end tell
    Navigate to the folder containing those files in the Finder and run the script.
    (65537)

  • Using Automator to Rename Files

    I can't figure out how to rename files so that the number in the name is in parentheses. For example Dog 1.jpg should be changed to Dog (1).jpg. How can I accomplish this in Automator?

    ok. the following should work. paste it into AppleScript Editor. select the files you want to rename in finder and press "run" in script editor. you might want to test it on a small number of files first.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder"
    set selected_items to selection
    repeat with this_item in selected_items
    set current_name to name of this_item as text
    set current_extension to name extension of this_item
    set length_extension to length of current_extension
    set name_no_ext to text 1 thru (-length_extension - 2) of current_name
    set AppleScript's text item delimiters to " "
    if (number of text items of name_no_ext > 1) then
    set z to last text item of name_no_ext --get the number at the end of the name before the extension
    set name of this_item to do shell script "echo " & quoted form of current_name & "|sed 's/" & z & "." & current_extension & "/(" & z & ")." & current_extension & "/'"
    end if
    set AppleScript's text item delimiters to ""
    end repeat
    end tell</pre>

  • Using Automator to copy files from a Windows network

    This has been covered before, but the solution didn't work for me, so excuse the mainly copy-and-paste article:
    I wrote an automator workflow to copy a chosen file located on a PC on the local network.
    Here is the workflow:
    Get Specified Servers
    Mount Servers
    Ask for Finder Items
    Copy Finder Items
    The workflow executes fine up until the workflow actually finishes copying all the files. The automator complains that the Copy Finder Items errors with the following message:
    Can't read directory contents: /Volumes/Files
    The other thread suggests choosing "Ignore Input" for the "Ask for Finder Items" action, which I did. But now I have a different error:
    Couldn't create: /Users/{my name}/Desktop/filename.xlsx
    Any ideas? Thanks!

    This has been covered before, but the solution didn't work for me, so excuse the mainly copy-and-paste article:
    I wrote an automator workflow to copy a chosen file located on a PC on the local network.
    Here is the workflow:
    Get Specified Servers
    Mount Servers
    Ask for Finder Items
    Copy Finder Items
    The workflow executes fine up until the workflow actually finishes copying all the files. The automator complains that the Copy Finder Items errors with the following message:
    Can't read directory contents: /Volumes/Files
    The other thread suggests choosing "Ignore Input" for the "Ask for Finder Items" action, which I did. But now I have a different error:
    Couldn't create: /Users/{my name}/Desktop/filename.xlsx
    Any ideas? Thanks!

  • How to use Automator to batch convert xls/xlsx files into tab OR pipe delimited text file.

    If you have answer, please provide specific and detailed steps.
    Situation 1:
    Start:
    150+ files in .xls OR .xlsx format
    data contains many characters EXCEPT "Tab"
    Process:
    Use Automator to:
    Select Files from Finder window
    Convert selected files from xls/xlsx to TAB-DELIMITED file format
    End:
    150+ files in .txt format
    files have identical names to those from "Start:"
    data is TAB-DELIMITED
    Situation 2:
    Start:
    150+ files in .xls OR .xlsx format
    data contains many characters EXCEPT | (pipe, vertical bar)
    Process:
    Use Automator to:
    Select Files from Finder window
    Convert selected files from xls/xlsx to |-delimited file format
    End:
    150+ files in .txt format
    files have identical names to those from "Start:"
    data is "|"-delimited

    If your post is addressed to my response then the answer is you have to write your own or search on-line to see if something exists to do what you want.
    As you note there is no pre-built script for this.
    regards
    Message was edited by: Frank Caggiano - Are you certain there isn;t something in Excel to export as a tab delimited file?
    This link Convert An Excel Spreadsheet To A Tab Delimited Text File seems to indicate that the function is in Excel already.

  • Using automator to render and save hundred's of LT files

    hello. I have a few hundred LiveType projects that I need to render to QT movie--need to make them eneditable but still usable in FCP--So, does anyone know if I can do this with Automator, i.e. point it at a folder and let it open, render, save to different folder and close (rinse/repeat)?
    Or is there an applescript that can do this?
    thanks in advance.

    Well, I was able to use automator, somewhat... where the hiccup occurs is when the file needs to be saved. If the render time takes more than a minute or so, then automator chokes. Fortunately, most of my files took less time to render, so the majority could be automated. When a hiccup occurred, the mac let out an alert sign and I manually rendered that file(s) and set automator up again until the next hiccup.
    there is a "timeout" selection in Automator for each step, but try as I may to get the save step to delay 3 minutes, it wouldn't work. I tried everything.

  • How can I use automator to import a .csv file into a an excel file

    I would still like all the import settings that I get if I am using excel to do the process, i.e. going in with the text format instead of the general format. That way my dates don't change

    You'll need to use Applescript in Automator.
    Note:  File extension cannot be CSV (Excel will assume that the file is comma separated), so add an action to copy or rename with extension TXT.
    (You can rename back at end of Workflow is needed)
    The Applescript Action is:
    on run {input, parameters}
         repeat with f in input
              tell application "Microsoft Excel"
                   open text file filename (f as string) data type delimited field info {{1, text format}} other char "|" with use other
              end tell
          end repeat
          eturn input
    end run
    NOTE: This is formating the 1st col to text
    If you need to format the second, then you need to:
      open text file filename (f as string) data type delimited field info {{1, general format}, {2, text format}} other char "|" with use other
    (You'll need to list the 1st col, 2nd col, etc until you get to the col to format as text).  Formats are (from the Applescript Excel Library):
    [field info list] : A list contain parse information for the individual columns of data.
    Formats are general format, text format, MDY format, DMY format, YMD format, MYD format, DYM format, YDM format, skip column.
    Or you can skip using Automator and just use an Applescript App (this is a droplet, just drop the files on the icon, or click to choose files):
    on run
         set fs to choose file with prompt "Select one or more files to open:" default location alias (the path to desktop folder as text) with multiple selections allowed
         proceed(fs)
    end run
    on open fs
         proceed(fs)
    end open
    on proceed(fs)
         repeat with f in fs
              tell application "Microsoft Excel"
                   open text file filename (f as string) data type delimited field info {{1, text format}} other char "|" with use other
               end tell
          end repeat
    end proceed

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • Replace text on files using automator

    Hi
    On an older (recently replaced Mac 10.4 etc) I used to be able to use Applescript to change the name of files within a folder very easily.
    Is there an easy way to do the same using Automator?
    This is used a lot during a normal day and would be very helpful. I haven't used Automator much, work keeps getting in the way!!
    Thanks for any help.
    M

    Your Applescript should still work, although it might need some modification.
    I haven't tried these.
    Automator Script to Rename Files
    Automator Script to Rename Files (2)

Maybe you are looking for

  • Error "Enter section code" while doing revenue recog for Korea company code

    Hi While doing revenue recognition  for a sales document using VF44 for Korea  company code , i got an error to "enter sectio code". There is no WHT for the customer, only VAT is entered in the sales price. How to resolve this issue, Please help. Tha

  • 'Unable to convert pdf; invalid page range or conversion setting parameters'

    Hello, I keep getting this error anytime I try to convert any type of ms 2003 file to pdf.  I've tried to reinstall my acrobat 8 professional twice and even ran a repair with no fix.  It almost just freezes.   I can say this: this error started when

  • Site says java not installed

    I have deleated java and reinstalled from sun but still I can communicate because the site cannot find java on my firefox. It is my bank site and there was no problem earlyer

  • What is the safest way to remove a virus from a Mac?

    Hello! I just ran a virus check using ClamXav and a virus popped up. The information for the virus is as follows: File name: 32294 . emlx Infection name: Heuristics. Phishing. Email. Spoofed Domain (There are no spaces before or after the periods.) I

  • Error When Installing Cisco ICM Maintenance Release 8.5(4)

    Hi,  I've successfully installing ICM 8.0(1a), My environment is Windows Server 2008 R2 Enterprise, Service Pack 1 x64. Now I'm trying to install Cisco ICM Maintenance Release 8.5(4), but the error occurs, the log is : 2014-09-03 14:09:27 [Informatio