Periodic "rebuilds" using automator or cron/shell?

Is it possible to invoke the equivalent of a "rebuild" for all mailboxes using automator or cron so that I can schedule a full rebuild every night.
I'm currently monitoring about 20 different email boxes, about 5 of which can get hundreds (if not a thousand) per day. I've got some pretty thorough spam filters on the both the back end (spam assassin) and front end (SpamSieve), but it still results in a few hundred "real" message I have to scan through each day.
My problem is that due to the raw amount of traffic, the inbox, sent mail, and Trash need rebuilding quite often (I manually delete out of trash a lot).
I'd love to find a way to run a "rebuild" function automatically at noon and midnight each day.
Any ideas how?
Thanks in advance!
Steve

I don't have the same kind of traffic you do, but I do have some pretty sizable mailboxes. I never delete anything from Trash or Sent. Once per year, near January 1, I dump everything from those mailboxes into new "Trash 20xx" and "Sent 20xx" mailboxes, moving as many as 1600 messages at one time. _I have never needed to rebuild a mailbox._
This does not solve your problem, but it does indicate that there's something wrong somewhere, and an automated rebuild is just a Band-Aid solution. The thing about a Band-Aid is that it doesn't cure the injury, and if you don't take it off for a long time, you could have a horrible, festering wound eventually. The same is true in computers.
So, I'd advise trying some troubleshooting. First, [repair the hard drive with Disk Utility|http://support.apple.com/kb/TS1417]. Next, try deleting the local copy of that mailbox from ~/Library/Mail/ (making sure you have at least two good backups first) and let Mail re-create it from scratch. If that doesn't help, try completely rebuilding Mail by deleting ~/Library/Preferences/com.apple.mail.plist and ~/Library/Mail/. (Just move them to the desktop, so you can import mail from the old Mail folder.) When you open Mail again, it will be as if you were opening it for the first time, so you'll need to have all the settings for your accounts written down so you can re-create those accounts.

Similar Messages

  • How to prevent Automator's "run shell script" to create fully decomposed forms of my strings ?

    I am using Automator's "run shell script" and I am seeing that it outputs fully decomposed forms of my strings.
    For example, when I set the action to "echo été" in a service (with "Replace selected text" activated) and run that into a Textwrangler window, I'll get fully decomposed forms that Textwrangler won't understand. But when I simply type that command into Terminal, I get my string in composed form.
    The problem is not the display issue, but the fact that if I want to run grep for example in "run shell script", I will not be able to find the proper strings since the forms are different.

    Originally I was using $@ to parse a string and get the result pasted by the service. That was a while ago. There, I noticed that some Japanese characters were messed up. Basically all the kana characters that come with voicing markers like が-ga (instead of か-ka) etc. I did not have the time to pursue that issue though.
    Then, last night, I found that a colleague of mine had tried to use $@ to feed to a local dictionary application called ding (http://ftp.tu-chemnitz.de/pub/Local/urz/ding/). His problem was with characters that had umlauts. After verifying how he wrote his action I remembered that I had similar issues with Japanese.
    Basically his command was "/path/to/ding $@"
    That's supposed to use the selected string as an argument to pass to ding, which will launch a Wish application where the string is used as the searched item.
    From Terminal, that works a treat. But the exact same line in Automator (with input as argument, not as stdin) messed the composition and the resulting string was not recognized by ding as a match to what it was supposed to match.
    So, I tried a few things to get to the core of the issue and found that a simple "echo [accented characters]" was enough to reproduce the difference in string handling between Automator and Terminal. That difference is also reproduced on a number of person's machines.
    I have a number of services that basically revolve on "run shell script" actions and involve 3rd party application outputs, preference files etc. so it would not be convenient to show that to you.
    I have sent a mail about this issue to the automator list yesterday too:
    http://lists.apple.com/archives/Automator-users/2011/Jun/msg00004.html

  • Pass text input to Shell using automator.

    Hello again Apple Community!
    What I am trying to do is use automator to promt the user for information like a username and password and then pass that information through a shell command to create a generic keychain item.
    What I have so far is an Automator "Ask for text" getting the username and the script I have so far is:
    on run {input, parameters}
      do shell script "security add-generic-password -a" & input & "-s servicename -w IAMZPASSWURD"
    end run
    But it will not take the input and include it in the shell script. Any ideas?

    I found the solution! It is a very very sublte mistake. Now Ive got it broken up into 4 chunks to build the command, though I'm sure it could be combined if needed.
    Get username:
    on run {input, parameters}
              tell me to activate
              display dialog "What is your username?" default answer ""
              set input to text returned of result
              return input
    end run
    Add username to shell command(I initially missed the space between the -a and the quote and the -w and the quote):
    on run {input, parameters}
              set thevariable to input
              set theScript to "security add-generic-password -a " & thevariable & " -s keychainitemname -w "
              return theScript
    end run
    Get password and add to end of command:
    on run {input, parameters}
              set theScript to input
              tell me to activate
              display dialog "What is your password?" default answer ""
              set ACP to text returned of result
              set keychaincan to input & ACP
              return keychaincan as string
    end run
    Finally, send the Shell Command:
    on run {input, parameters}
      do shell script (input)
              return input
    end run
    Hope this helps anyone trying to accomplish this same thing!

  • Unmount dead hard disk on start up using automator

    I have a powerbook with a dead internal hard drive.
    I currently boot from a firewire drive just fine
    using a Carbon Copy Clone of the other drive.
    Just one problem: the hard drive clicks for about 15 minutes
    trying to work, and then gives up.
    I would like to create an applescript, or use automator,
    to automatically unmount the dead drive on startup,
    so that the system will stop trying to reference it
    and it will stop its accursed clicking.
    What is the default path to the internal hard drive?
    This is the best partial lead I have gotten so far, for unmounting an inappropriate volume; I am aware the syntax or path may be off.
    Also: Disk Utility does not find the dead drive... period.
    Thanks for any suggestions or solutions
    Mo Lohaus
    Partial Lead:
    Open up /Applications/Applescript/Script Editor, and enter this:
    do shell script "diskutil unmount \"/Volumes/WindowsPartition\""
    Replace WindowsPartition with the name of the partition that has Windows on it.
    Hit the Compile button, and then File -> Save As... -> Save as application.Save the newly created application somewhere, like /Applications.
    Then go to System Preferences -> Login items, and make the app a login item. Check the hide box and you won't see the icon in the dock.
    When you first log in after a restart, the partition will be mounted, but will unmount after about 10 seconds or so. Hopefully that is secure enough for your needs.

    You could visit the iFixit.com site and read through their guides
    on how to replace the hard disk drive in your computer, & do it.
    • PowerBook Repair - iFixit:
    http://www.ifixit.com/Browse/PowerBook
    Usually the PowerBook design is less difficult than the iBook
    when it comes to replacement of an internal hard disk drive.
    And I'm wondering, if you can use the X or other key on startup
    to find another boot volume on an external hard disk drive to
    run the computer from, to choose an alternative without having
    the internal failed hard drive clicking away all that time. Yet, to
    have the working external FW drive seen immediately by the
    PowerBook, seems well within reasonable reach.
    I've ran many computers from a clone or second system outside
    of the computer's case, using the System's startup disk panel to
    choose it. So, if the external is available to the computer, and it
    is seen correctly, the internal drive should not chatter or try to run.
    Replacement of the internal hard disk drive, of course, remains
    to be the ideal answer; as you undoubtedly realize. Perhaps
    the pressing nature of this will force you into taking the plunge.
    Good luck & happy computing!

  • Using Automator to run ActivePerl?

    (It was suggested that I post this here. Previously posted under Leopard/Automator. Note: I also considered trying to run my program at boot using launchd, but was intimidated by the sample scripts I saw. If someone can shovel me that code, I'd be grateful, but otherwise I'll keep trying to utilize the far simpler Automator application. --Peter)
    Hi all,
    I'm new to Mac OS and, well, a bit lost.
    I've been running ActivePerl (a perl interpretor) from a Terminal prompt, passing in my program source file as an argument, as follows:
    perl <path>/program_file
    Program_file opens a GUI and waits for user input (ie, it does not terminate on its own). Until the user terminates this GUI (terminating ActivePerl as well), I note that a Terminal-looking icon appears on the Dock. All well and fine.
    Now I'd like to have Automator run program_file at boot.
    Running an Automator bash shell script with the same single line, Automator gave me a less-than-helpful message: "The action 'Run Shell Script' encountered an error. Check the action's properties and try running the workflow again."
    So I figured I'd instead simply run an Automator perl shell script with the single line:
    print system ("<path>/perl", "<path>/program_file");
    A bit more successful, I believe this at least attempts to start ActivePerl and run program_file (a Terminal-looking icon briefly flashes on the Dock). But my GUI does not open -- program_file along with ActivePerl seem to have been terminated.
    (Automator returns 512 to the print call. I can't locate a description for "512" in Mac OS X Reference Library's "Shell Scripting Primer" -- if this is where I should be looking and if this return code is even significant.)
    This ought to be a very simple task. What am I missing here?
    Sincere thanks.
    Peter

    (Automator returns 512 to the print call. I can't locate a description for "512" in Mac OS X Reference Library's "Shell Scripting Primer" -- if this is where I should be looking and if this return code is even significant.)
    This is most likely
    #define ENOENT 2 /* No such file or directory */
    I could be wrong, so take this with a grain of salt.
    One form of program completion status is formatted as
    8bits 8bits
    | | |
    | errno | signal |
    |_______|_______|
    0000:0010:0000:0000
    So if my guess is correct, then 512 is breaks down into a value of 2 in the errno byte and a value of 0 in the signal byte.
    This also makes sense in that it is unlikely an Automator run would get a signal, and it is not unusual for someone to assume that the PATH used by their Terminal session is the same everywhere, and that is often NOT true, so commands your Terminal finds are not always findable by Automator, Launchd, cron, Applescript, etc...
    For example, while you might specify the full path to your perl script, that does not mean that any commands run inside the perl script will find their commands.
    You say ActivePerl. Well is that a special version of Perl? Where is it located? Does it have any special features that are NOT part of the default Perl?
    I do have -- as far as I understand these things -- $PATH set correctly in my home directory's .profile file. I'll check this Friday, too.
    Having the correct PATH set for your Terminal session means nothing to Automator. If you have things in your perl script that depend on a custom PATH, then you are in trouble.
    You might want to create an experimental Automator that is "Run Shell Script". Change the "cat" command to:
    printenv
    Run this workflow in Automator. Click on the "Results". You will most likely see
    SHELL=/bin/bash
    TMPDIR=/var/folders/zv/zvU6bMiHTeElG+JIWOdzk++TI/-Tmp-/
    ApplePubSub_SocketRender=/tmp/launch-s1i3Ke/Render
    USER=harris
    COMMAND_MODE=unix2003
    SSHAUTHSOCK=/tmp/launch-6mdwXe/Listeners
    _CF_USER_TEXTENCODING=0x1F5:0:0
    PATH=/usr/bin:/bin:/usr/sbin:/sbin
    PWD=/Users/yourusername
    DBUSLAUNCHD_SESSION_BUS_SOCKET=/tmp/launch-V5WJ8H/unix_domainlistener
    SHLVL=1
    HOME=/Users/yourusername
    LOGNAME=yourusername
    DISPLAY=/tmp/launch-Pq6WiM/:0
    _=/usr/bin/printenv
    Notice that PATH is "/usr/bin:/bin:/usr/sbin:/sbin". That is it. If your Perl script cannot find everything it needs in one of those directories, then you are going to have to either arrange your Perl script to provide full paths to anything it needs outside of PATH, or you are going to have to modify your Automator workflow so it sets up a PATH that makes your Perl script happy. For exampe you could setup your "Run Shell Script" something like:
    export PATH="$PATH:/your/custom/path:/another/custom/path"
    /path/to/your/desired/version/of/perl /path/to/your/perl/script
    Maybe this won't be as simple as I thought it should be. (Laugh or sigh at me, but I like Windows because I don't need to deal with this sort of thing! Stuff just happens by itself. No, I should not entertain programming as a profession.)
    Changing environments is always difficult because you keep trying to do thing the old way, because that is what you know. This is a natural situation.
    So maybe if you actually told us what you really trying to do, someone can suggest an easier way to do what you want. You have only told us your solution, and not what you want to do.
    We know you want to prompt for something, and you want to do this at boot time. We don't know why you want to do this, or what this GUI is displaying, what action you want the user (you) to do with this GUI display. Again, maybe there is another way to do what you want which is more Mac like and easier.

  • How to resize and change the resolution of a batch of photos using Automator

    I searched for a long time tonight looking for the answer to this (seemingly) simple question:
    How do I use Automator to scale and change the resolution of a batch of images?
    It was not so simple.
    Links to this question:
    https://discussions.apple.com/message/12341246#12341246
    https://discussions.apple.com/message/12342026#12342026
    https://discussions.apple.com/message/5785047#5785047
    https://discussions.apple.com/message/1173358#1173358
    https://discussions.apple.com/message/5641853#5641853
    https://discussions.apple.com/message/3207516#3207516
    These are just the links on this site - I found them all over the place at MacRumors, Apple Tips, Mac Help, etc.
    You can actually manage this in Automator.
    Here are the steps that worked for me:
    Create an Automator APPLICATION - not a workflow (this is due to the way that I'm batch converting images - workflows might be ok for some cases)
    Step 1 is Copy Finder Items
    My flow inserts an SD card, opens the DCIM folder that my Nikon creates, selecting the images that I click (command + click to multi-select) and once I have the photos highlighted, I drag them onto this Automator App we're creating.
    <==  You'll have this guy soon!
    As a result - I want to copy the originals to my computer as step 1.  I don't touch the originals on the SD card (and cards are cheap so I tend to leave them on the cards as well)
    Step 2 is the Scale Images action - you can search the library for this and find it quickly.  For my part, I found that scaling images to about 38.8 percent of their size on the SD card is good for uploading to a blog.  Change this value to whatever you wish.
    Step 3 is Run Shell Script - and here is where we marry the brilliance found at this link with our script.If you have a hard time reading the text in the image, it is as follows:
    #bin/bash
    for f in "$@"
    do
         /usr/bin/sips -s dpiHeight 72.0 -s dpiWidth 72.0 $f
    done
    Save this application (I named mine "Format Photos")
    Place the application inside the target folder where you want the images to end up.  I do this because when I have the SD card window open, I can also open my "Photos" window and see my App sitting there.  I select my images as I mentioned and drag them on top of this app.  The app copies the originals and the conversions into the folder.
    NOTES: When you open a converted pic in Preview, you will see Resolution = 300 dpi if you go to Tools --> Adjust Size...  This reading is explained by another brilliant discussion as sips only touches the JFIF properties inside the file's MetaData.  However, if you look at the bottom of the Adjust Size... window, you'll see the image size is probably around 500 kb (give or take depending on the original).  My goal was to get the images down from the 3.0 MB I shoot at to around 500 kb.  Therefore even though the MetaData still thinks that it is 300 DPI according to Preview, it has been changed to 72 (open it in some other applications mentioned at the links and you'll find different readings - it all depends on what the application reads from the Meta).
    This does not rename the files, so you'll get DSC_1000.jpg and DSC_1000 copy.jpg in all likelihood.  If that annoys you, add a step into the Automator Application that renames the file after the "Run Shell Script" action has run, and you can have each file renamed according to some convention that you like.
    This took a heck of a lot longer than I expected - so I decided to put in the effort to share this with the community and save others the hassle. 

    PPI is pixels per inch of the image.  It is difficult to increase resolution as you are trying to add data that is not there.
    But for printing purposes what you want is dpi or dots per inch.
    The image processor either accessed from Bridge (tools/photoshp) or PS is a good way to change a batch of images.

  • Using automator to edit text - find and replace

    Hello. I have a huge database of tv repair tips. Unfortunately, when i started to accumulate the tips I put them in an html table like this:
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">36XBR400 </td>
    <td class="NoiseDataTD">DEAD - NO H.V. - INTERMITTENT START UP - 'D Board' NG. </td>
    <td class="NoiseDataTD">IC6501, MCZ3001D 0r MCZ3001DB(8-759-670-30) - >>>HARD TO REPLACE!---tip:CUT PINS FROM TOP THEN PULL OUT SLOWLY </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">63A </td>
    <td class="NoiseDataTD">INSUFFICIENT HEIGHT </td>
    <td class="NoiseDataTD">CHECK C522 REPLACE IF PARTIALLY OR COMPLETELY OPEN </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2 </td>
    <td class="NoiseDataTD">Int. loss of pix (HV) after 10 Min. Audio Normal.Pwr up again & OK for 10Min </td>
    <td class="NoiseDataTD">H Protect Circuit. D521 (7.5 zener) ECG5015 </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2D </td>
    <td class="NoiseDataTD">VERTICAL HEIGHT PROBLEM </td>
    <td class="NoiseDataTD">BAD YOKE: BAD YOKE WINDINGS MEASURED 6 OHMS, SHOULD BE CLOSE TO 9 OHMS </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2W </td>
    <td class="NoiseDataTD">Negative main pix, pip video ok. Customer heard pop then pix went dark. </td>
    <td class="NoiseDataTD">IC355. CSA2131S </td>
    </tr>
    Now, I want to input the tips into a MySQL database with an insert statement like:
    INSERT INTO `otips` (`id`, `brand`, `model`, `problem`, `solution`, `user`, `date`) VALUES (NULL, UCASE('SONY'), UCASE('KP-53XBR200'), UCASE('CONVERGENCE OFF'), UCASE('REPLACED CONVERGENCE IC''S STK392-020 AND PICO FUSE PS5007 3.15 AMP open'), '0', '0000-00-00');
    I've been all over the help files and different websites with tutorials and I cannot figure out how to do this using automator. Could anyone tell me if this can be done with automator and perhaps point me in the right direction.
    Thanks,
    daniel
    IMac Intel Core Duo   Mac OS X (10.4.8)  

    Are you familliar with regular expressions? If you are, then you can create a shell script and incorporate it into your workflow. Or you could use bbedit or textwrangler from barebones.com to search and replace in multiple files.

  • 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

  • Announcement/message before shutdown by using Automator?

    I wondered if it was possible to show a message or announcement when I try to shut down, like a message of some sorts that reminds me to set my Magic Mouse on off to save batteries and stuff like that. I'm not experienced enough with Applescript to know if it's possible by using Automator. If it is: how do I do it?

    This will only trigger if you run the Automator workflow to shut down the system. You can alternatively set up a logout hook to trigger such a message a logout. First create a small applescript that will issue the desired alerts and prompts an then shut down. Then create a small shell script that uses the "osascript" command to execute the applescript. You can also save the Automator workflow as an application and then target this application for execution directly from the shell script instead of using "osascript" (there are ultimately many ways to go about this).
    Then create the logout hook so it points to the shell script, by opening the Terminal and running the following command:
    sudo defaults write com.apple.loginwindow LogoutHook /path/to/script
    When experimenting with this, if you cannot get it to work then you can undo this hook setting by running the following command:
    sudo defaults delete com.apple.loginwindow LogoutHook

  • 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!

  • Using Automator to Batch Create PDFs

    I've been trying to find a way to make an Automator workflow that will take the name of a folder and combine it's files into a PDF with as little manual input as possible and have finally figured out how to do so. I've seen others ask how to do this for a while so I wanted to share how I did it.
    Why would you want to create PDFs? If you have scanned books, photos, documents or anything else on your Mac, you can create PDFs out of them. You can then store these in iTunes and either read them using Preview on your Mac or iBooks on your iOS device.
    What this workflow will do:
    Take a folder with images, get the folder's name, and create a PDF of the images with it's name.
    On the next pass of the workflow, it will send the previous folder to the trash.
    Create/have a backup of your files!
    Create a folder somewhere that you can drop your folders in. Name it Automator Dropbox. You can create one wherever you want, but this workflow was created with Automator Dropbox in mind so you'll need to change it as necessary.
    Open Automator and create a new workflow.
    Find Finder Items
    - Search Automator Dropbox
    - [All] of the following are true:
    - [Label] is [Red]
    This will search for any folders that were done before.
    Move Finder Items to Trash
    This will move the previous folder/files to the trash.
    Ask for Finder Items
    - Prompt: [Choose a Folder]
    - Start at: Automator Dropbox
    - Type: [Folders]
    This will ask you to choose the next item to convert to PDF.
    Set Value of Variable
    - Variable: pdfvariable
    This will take the name of the folder you just selected and use it to to rename your PDF.
    Label Finder Items
    - [Red]
    This will mark the folder you're working on for deletion the next time the workflow is ran.
    Get Folder Contents
    This will grab all the image files within the folder so that it can create a PDF out of them.
    Scale Images
    - To size (pixels): 1600
    This will scale the maximum dimension of your image down (or up) to 1600px. I find this to be the sweet spot for performance on the iPad 3, and it looks just fine. If the maximum dimension of your image is lower than 1600px, I'd create a duplicate workflow of this and leave out this step; otherwise you will be upscaling and your image won't look as good. You can also leave this step out if you want your original image size kept, but on the iPad 3 and below there will be a delay going from page to page.
    New PDF From Images
    - Save Output to: [Desktop]
    - Output File Name: tempname
    This will save your finalized PDF to the Desktop. You can change this to whatever you want; I would suggest the Automatically Add to iTunes folder located in [Music > iTunes > iTunes Media > Automatically Add to iTunes]. You will find your PDF in the Books category in iTunes.
    Rename Finder Items
    - [Replace Text]
    - Find: tempname in [Full Name]. Ignore Case checked.
    - Replace: [pdfvariable] (Drag pdfvariable from the variables window into the text field for "Replace". If you don't see the variables, go to "View > Variables."
    You can't just drag the variable into the PDF name field in the step above, so this extra step is necessary. It will rename your PDF with the name of the folder it was created from. It will also add the full file path, which will be taken care of in the next step.
    Rename Finder Items
    - [Replace Text]
    - Find: Users/yourname/Documents/Automator Dropbox in [Full Name]. Ignore Case checked.
    - Replace: LEAVE EMPTY
    This will delete the name of the path from the name of your PDF. If your working folder is not Documents/Automator Dropbox, change it to whatever that is.
    If you're running this workflow on a bunch of folders, you can simply keep your cursor over the workflow's play button and press the right arrow + enter to select the next item in queue. This workflow was made for using a little human interaction as possible, so if anyone has suggestions on how to improve on it please post below.
    One last thing - if you're seeing a red folder when you run the workflow to choose a folder, it's because spotlight hasn't indexed it yet and the workflow could not find it to delete it. Just go on to the next item.

    Someone (not me) has created an automator workflow that does this, using a shell script that runs the "pstopdf" unix command. I just downloaded it and tested it on 10 .eps files. You will need to edit the first automator action in the workflow to find the eps files you want (by default it looks for all eps files on your computer), but once you do that, it works like a charm! Converted my eps files to pdf's. Of course, once they are pdf files, you can use automator to convert them to whatever format you want.
    http://mad-sci.blogspot.com/2007/12/why-i-hate-computers.html
    (link to the actual zip file containing the workflow below)
    http://www.physics.mcgill.ca/~burkes/code/PDFworkflows.zip

  • Can I use automator to pull contact info from Craigslist? I am new to automator, but I am thinking it is possible for sure.

    Hello all!
    I would like to be able to reply to a large amount of Craigslist emails by pulling the contact info from Craigslist using Automator and putting the emails in a text document.
    I have Automator set to:
    1. Open Safari
    2. Open the Craigslist section an city I want.
    3. Pull a list of active listings URL'S
    Beyond that, I can not figure out how to have Automator open one page at a time and click the contact info button and then copy the  needed info into my text document.
    I can have it open all 150 links at one time.....lol but that wont work on my Macbook!!!!
    Help please!!!

    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

  • Using automator/applescript to do terminal commands/ssh

    hi,
    pardon my extreme novice question here, but i was looking for quick & easy ways to create a small applet to basically run a script on a web server to remotely check & update it's IP address with its web host, and also serve internet services to a wifi access point.
    here's the basic stuff we usually do in terminal —
    my-Computer:~ admin-user$ ssh admin@+{web server IP, ex.: 0.0.0.0}+
    +{we then have to wait for it to connect and ask for a password}+
    Password: {our input for password}
    Last login: Sat Jun 14 15:04:58 2008 from 0.0.0.10
    Welcome to Darwin! +{so we are now connected}+
    www:~ webserver-admin$ sudo /var/root/IP_update.sh
    +{there is then a long output as that script runs and updates the IP with the web host}+
    www:~ webserver-admin$ sudo route add -net 0.0.0.0/24 0.0.0.3 +{serve up internet services to a wifi access point, returns output that it was done, failed or already connected}+
    www:~ webserver-admin$ sudo /opt/local/sbin/lighttpd -f /opt/local/etc/lighttpd/lighttpd.conf & +{starts up our web server, returns that it was started or already on because port 80 is in use}+
    so that's what i want it to do. i thought using automator and the *run shell script* option in it would work, but i can't even get past the first ssh command without an error. i have it set to use /bin/sh, and have tried it with *pass input* setting set either way, *to stdin* or as arguments, but in either case, just on this first line alone, i get the following error —
    Run shell script failed
    Pseudo-terminal will not be allocated because stdin in not a terminal.
    does anyone know why this is happening? how do i get around this and proceed on with my script using automator?
    also, if anyone could please give tips about how to use the "pause" to have it wait for prompts over the network (like the "Password:" prompt coming back after an indeterminate number of seconds) and which automator command might be used to pop up a dialogue for user input (like asking for the password), it would be much appreciated. thanx.

    You'd want the *do shell script* command in AppleScript for this
    http://developer.apple.com/technotes/tn2002/tn2065.html
    however you're not going to be able to use it as you would tools such as Expect which allow you to wait and provide additional input on stdin. If all you're doing is updating an IP address why not simplify the entire mess with BIND's dynamic updates?

  • Using Automator to open a program with a delay after a programmed restart

    Hi to all! With my old PowerPc I used to start unattended sessions of my Newsreader (Unison) overnight simply putting Unison in my Login elements window, and programming a restart at a fixed hour. Unfortunately, with my very fast new iMac this doesn't work: Unison opens too fast after the programmed restart, before a network connection has been established, and Unison is unable to see the NewsServer online when it starts (error "nodelist not found", typical of a not yet established Internet connection). Note that I downgrade to Unison 1.8.x to do this, as the Unison 2.x program cannot be closed with a session running to resume it after start: it simply defaults to "Pause transfers" after quitting, and need a clic on "Resume" after reopening.
    Obviously, what I need is to introduce a "wait (say) 2 minutes before the opening of Unison", or anything that can check the Internet connection before Unison starts. May anyone instruct me to do this with Automator and/or AppleScript?
    In fact, I tried to generate a workflow in Automator, with a Pause after the start of the process, then the instruction to open Unison. I put the saved workflow in my Login elements, but it didn't work on my iMac 27, i7Core, Snow Leopard installed. I added an "execute workflow" at beginning of the process, but the Pause command gives always an error and the process stops before Unison' opening.
    Any suggestion or help in writing an Automator or AppleScript workflow/script to be put among the startup items?
    Thanks a lot!

    I am trying to use Automator to restart an application. I figured how to quit the application, however when I relaunch it, it asks for password permission... how can I use automator to enter the password? or is there a way to launch the software with password in a script?

  • 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.

Maybe you are looking for

  • How to Output to MXF format

    We edit with FCPx 10.0.3.  We are having all kinds of problems trying to render the files to meet specs required by a broadcast station.  The program, for airing on Australian TV, is an edited version of a US program supplied to us in NTSC format whi

  • Err: Mail Adapter

    Hi all, I had config. the mail adapter at receiver side, with Transport Protocol SMTP and check the keep attachment. Now I got this error, checked in RWB "Mail: Configuration error: Channel 060f1137a095350a8ce839186d4ca610is not configured for XIMail

  • Java.io,IO​Exception: Failed to transmit error in whatsapp..​...HELP!!

    I get java.io,IOException: Failed to transmit when I input my phone number into Whatsapp.  I need help to get past it because I have made sure my data has stayed on while trying to connect and it still has not worked and I keep getting this message. 

  • Ipad Restore: If I restore to factory settings do I lose my game data?

    I was having some issues with my iPad. The keyboard was slow and sometimes non-responsive. I have found a temperary fix but would like my iPad to be back to normal (or more so then now). I went to simply computing and was told to try restoring to fac

  • Hi all....i'm feeling rather stupid..lost iTunes

    I used ITunes years ago on a talktalk email...and now I have got a new iPhone 5s I am starting to use it again. Everything on new phone is with gmail addy...but when I access iTunes it still wants log in with talktalk addy...which is a pain...but fin