How do you run a script?

Hi...could someone please post explicit instructions on how to run a script in Leopard? I want to run the script below in order to delete all the originals from my iPhoto library and free up loads of space (I have 10,000 photos, almost ALL of them have been altered from the original). The problem is, I dont know how to run a script or even what a script is! Can someone post how to do this for the mot very basic beginner? Here is the script:
mkdir ~/.Trash/iPhoto-Originals
cd ~/"Pictures/iPhoto Library/Modified/"
find . -type f -exec mv "../Originals/{}" ~/.Trash/iPhoto-Originals/ \;
Thanks!
Kevin

If you wanted to do this on a regular basis, you could put those commands into an Automator workflow, save it as an applications, and then whenever you want to repeat this operation you just double-click on the Automator file.
Applications -> Automator
Custom -> Utilities -> Run Shell Script
Drag those shell commands into the Automator *Run Shell Script* window, replacing the word cat you will see when the *Run Shell Script* panel opens.
Save As...
File Format: Application
Save

Similar Messages

  • How do I run a script on a .indb file?

    How do I run a script on a .indb file? What should I do differently than in running one on a single indd file?

    I do this like so:
    var inddFiles = GetFilesFromBook();
    for (var i = 0; i < inddFiles.length; i++) {
        inddFile = inddFiles[i];
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
        doc = app.open(inddFile);
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
        // Process document
        doc.close(SaveOptions.YES);
    function GetFilesFromBook() {
        var bookContent, file,
        activeBook = app.activeBook,
        files = [];
        for (var i = 0; i < activeBook.bookContents.length; i++) {
            bookContent = activeBook.bookContents[i];
            if (bookContent.status != BookContentStatus.MISSING_DOCUMENT) {
                file = new File(bookContent.fullName);
                files.push(file);
        return files;
    Here is the whole script that you can use as example.

  • How do you pass shell scripts with cocoa?

    How do you pass shell scripts with cocoa?

    You asked for more detail -- I don't know if this is what you were referring to or not, but here's a little more detail on how to use the system() function if that's what you wanted to know.
    As etresoft mentioned, the system() function can be useful for the kind of thing you are talking about. You will need to write the following statement at the top of your code if you want to use it:
    #include <stdlib.h>
    To use the system() function, simply put the command as you would write it in the Terminal between double quotes between the parenthesis. For example, something as simple as:
    system("ls");
    I don't what the practical use of the above statement would be, but it will run, and that's the general format for the system() function. So just put between the quotes whatever command you want to send.
    Hope there was something helpful here.

  • How can i run unix script from my apex page

    how can i run unix script from my apex page and take the output of unix script as a hidden variable and display it on the report region of that page

    I had a requirement to run a Fortran program against some data that woudl be extracted from the database after the user set up their filtering criteria and made some additional input. SInce the program was to complex to conver to PL/SQL, we decided to try and invoke it from Apex. This is how I did it.
    1. I followed the steps in Tim Archer's excellent article "Oracle External Procedure to Run Host Commands" (http://www.timarcher.com/?q=node/9). If the link does nto work, google the article's title.
    Using this steps I created a function which accepts any OS command, including calling my own shell scripts, and runs them. I called my PL/SQL function "shell" instead of "USF_RUN_HOST_CMD " as Tim did in his example (step 9).
    2. In Apex,
    a. I created a button to run my shell command. (I named it P2_RUN_SHELL)
    b. I created a PL/SQL process whose source looks as follows:
    shell('/home/ackness/scripts/cr_xcf_file.sh > /tmp/cr_scfp_file.log');
    and which was conditioned on the the button P2_RUN_SHELL.
    It works like a charm.
    Note: since you can run your own scripts using this method, you can encapsulate a series of commands in a UNIX shell script and invoke that script from Apex. This allows you to be able to test or run you commands from the command line as well as Apex and makes it easier to develop/debug/enhance the scripts in the future.
    Ackness

  • Is it possible to run host command from SAP environment? How do you run?

    Hi
    Is it possible to run host command from SAP environment? How do you run?
    Thank You

    Hello Subhash
    You will more details in the following thread:
    Re: How to define command for SXPG_COMMAND_EXECUTE
    Regards
      Uwe

  • How do you run apps on creative cloud? I can't seem to run them or see them on my desktop

    How do you run apps on creative cloud? I can't seem to run them or see them on my desktop

    Hi JasonLuong,
    You will have to go to www.creative.adobe.com and login with your Adobe Id on which you have purchased the subscription.
    You can go to the download center and then start downloading all the cc apps available. It will first download and install the Creative cloud desktop tool in your computer. This creative cloud desktop will show you the option to download all the CC programs, the updates, etc.
    Thanks
    Kapil Rupani

  • How do you run Adobe Reader with New Lions

    How do you run Adobe Reader with New Lions?

    Lion has Preview, you may not need Adobe Reader.
    Preview Help
    View your images and PDF documents, touch them up, annotate them, and share your comments.
    Regards,
    Colin R.

  • How do you run a Wagetype G/L report in SAP

    Hi SAP experts
    In SAP system,How do you run a Wagetype G/L report?
    regards
    Krishna

    Aarti
    Thanks for your answers,this was the report I was  looking for .
    Full points awarded to you .we can also use this transaction code directly
    PC00_M99_DKON
    regards
    krishna

  • How do you run a full virus scan

    How do you run a full virus scan on the Imac

    Take a look at this article:
    http://en.wikipedia.org/wiki/Phishing
    Running a virus scan would not help at all - someone got your email address and is now hoping you're dumb enough to use the links they provided and give them information so they can use your credit card or checking acount number, password, etc.
    I would change my user name and password immediately (if not sooner!!) - make it difficult to guess. Do it at least with the bank involved; however, to be safe, it wouldn't hurt doing it with others as well.

  • HT5246 How do you run the Flashback malware removal tool?

    How do you run the Flashback malware removal tool?
    Thanks

    I am away from my computer and it is somewhat awkward to reply on an iPad.
    > I had already done what softwater instructed. I've read that it deletes itself on other threads, but it's still in my Finder as a Device. That's what confused me, because it doesn't appear to have deleted itself.
    Sorry, I wasn't clear. That is not the tool. It is the .dmg image mounted to your desktop. Next to the name you will see a small eject icon. Click on it or highlight it and choose "Eject" from the appropriate Finder menu. Once that happens you can drag the .dmg file to the trash as it will not delete itself.
    > I only recently upgraded to Snow Leopard and then Lion, in quick succession. My understanding is that there were (are) variants that would have infected my computer prior to my upgrading my OS to Lion. Before the upgrade, they were Adobe, but afterward they were Java. Could it be that be that the pop-ups were/are some other variant?
    Difficult to say for certain. Apple says it deletes all the common variants but does not specify which and I haven't seen the results of any testing done to verify that it finds and deletes those. The only dialogs that appeared with the initial variants were for FlashPlayer. They are depicted in the descriptions for Flashback-A on F-Secures site if you want to take a look. There have been none that I am aware of for Java, so that is probably either a web page or application that needs Java to run giving you that alert.
    > If the Flashback malware removal tool didn't find anything and my Software Update is current, does that mean the vulnerability has been fixed? At least for now? I understand that I Software Update will prompt downloads in the future if and when it needs to be patched again.
    The vulnerability is in Java, nowhere else, so if you don't have it installed there was nothing to fix.
    If you download Java in the future it will be the latest version Apple has available at the time, which hopefully will not be subject to exploitation, yet...

  • How can I run a script last?

    Hiya,
    I have a single backup job running a single dataset. That single dataset has an include statement to include a dataset directory, which holds individual datasets for the several hosts I want to back up, each with potentially different parameters. This works well, the hosts back up in some order (I don't care), everything's happy.
    However, what I want to do is add a step on the end of this process to run a report on the admin server after all the backups are complete. That is, to run a script once, last.
    If I add an "after backup" command in the dataset, it runs it (as stated in the manual) on the client servers, after every backup, which is no good to me. I've tried creating a separate job and scheduling it at a lower priority a few minutes later than the backup job, but that seems to just run when it feels like it, I presume because there aren't any conflicts so why shouldn't it?
    Can anyone advise how I should be doing this?
    Related question... I've tried putting an "after backup" step on the Catalog backup job, but that appears to get run twice (I presume because there are two "include" steps in the catalog dataset)! Is this expected? How can I get it to just run once, after the catalog backup is complete?
    Thanks,
    David.

    Thanks Donna, but... no. It didn't work.
    We've actually purchased a license for OSB, so I've fired this question at our official support channel now, and they came back with the same answer at the same time (are you the Oracle techie looking at my problem, by any chance?). For the record here's (with some tweaks for readability in this context) what I've sent back in response to that article.
    From the article, I thought perhaps the following might do the trick:
    include dataset /Hosts {
    after backup optional "/usr/local/osb/pre-n-post after-fsd-hosts mail"
    But, from the log:
    2010/11/05.07:26:58 trouble parsing dataset in FSdaily line 1 - open brace appears where not allowed (OB dataset mgr)
    "010/11/05.07:26:58 offending line is "include dataset /Hosts {
    2010/11/05.07:26:58 trouble parsing dataset in FSdaily line 3 - bad nesting (OB dataset mgr)
    "010/11/05.07:26:58 offending line is "}
    So it appears I’m not actually allowed to do that. I don’t understand why that would be.
    The only other idea I have is to include a dummy backup step, backing up something really small (because OSB won’t let you run a backup without backing anything up - sigh!), tack a script onto that, and hope like heck OSB decides that it should run that last. All the documentation I’ve read gives the impression that datasets are all about scope, not order, so I’m not altogether confident that this will work. In any case, it seems a pretty kludgy way of doing it! And, given the next paragraph below, I’m not all that sure it’ll work in any case.
    My idea of scheduling a catalog backup for five minutes later than the client backups, with a lower priority, so that it runs when the client backups finish, also has a flaw - if I use two tape drives in parallel, it runs the catalog job in parallel with the last client job, which is completely useless. I want to put on the end of the tape a backup of the catalog as at just after the client backups, so that in the case of a disaster I can restore that and I’ll be good to restore everything else.
    In addition to being completely useless for the purposes of putting an “after” catalog backup on the end of the tape, it’s also completely useless for the purposes of running a script last - I tried the following:
    include catalog {
    after backup optional "/usr/local/osb/pre-n-post after-catalog mail"
    This ran the pre-n-post script twice, once for each component of the catalog, which is altogether not what I want it to do.
    I can’t think of any way to achieve a catalog backup on the end of the script except for scheduling it for some time later and hoping the dataset backups always finish by then. Ugly.
    The only way I can think to achieve the run-a-script-last is to munge all the datasets together into one humongous dataset file, and do stuff as in the article to try to bend OSB to my will (again, hoping that OSB obeys the order of statements in the dataset). Which, when I’m given the ability to use “include dataset /Hosts” to make it easy to maintain, seems a bit of a mean trick to pull on me. And, again, with two tape drives available I’m not at all sure it’ll work in any case.
    I'll post further results as they come to light...
    David.

  • How Can I run a script to all servers in my servers list

    Hi Guys
    I have a Servers list:servers.txt , it's including all servers i need to run a powershell script,how can I use the powershell to run a script on those servers? thank you.I just start to learn about powershell.

    You can pipe the results of Out-Command to Out-File (or Export-Csv, etc.)  I'm not sure what kind of objects you're expecting from this script, so I'll err on the side of caution and use Format-List * in the example:
    Invoke-Command -ComputerName $servers -FilePath c:\copy.ps1 |
    Format-List -Property * |
    Out-File -FilePath $home\Desktop\copy.log

  • How do you run .exe files with wine by clicking on them?

    Hi, I need help with using wine on mac osx. I used to use wine on Ubuntu and Linux Mint and it was relatively simple. But on mac osx, I used macports to dowload/install wine, and i used winecfg to create a prefix. I can not figure out for the life of me how to launch an executable by clicking on it. It opens in TextEdit instead of launching in wine. Can someone explain to me how to make a .exe file launch by clicking on it? Do i have to register the filetype with wine? Wine is not in a .app format. I can run any .exe in terminal but it is less than convenient. Thanks in advance.

    So wrap Wine in an application, and bind the .exe's to the wrapper application.
    Platypus (free download)
    <http://www.versiontracker.com/dyn/moreinfo/macosx/19870>
    Can be used to turn any Unix program or script into a double clickable application, as well as a drag and drop target application.
    It should be possible to wrap Wine with Platypus.
    As an alternative, you might try Applications -> Automator -> Run Shell Script workflow, and save that as an application. Then bind your .exe's to that workflow you created.
    NOTE: I have not played with Wine, so your mileage may vary.

  • How can I run a script on suspend/resume?

    I'd like to run a script when a machine is about to suspend and another after it resumes. Is this possible?

    You can pipe the results of Out-Command to Out-File (or Export-Csv, etc.)  I'm not sure what kind of objects you're expecting from this script, so I'll err on the side of caution and use Format-List * in the example:
    Invoke-Command -ComputerName $servers -FilePath c:\copy.ps1 |
    Format-List -Property * |
    Out-File -FilePath $home\Desktop\copy.log

  • How do you run Windows on a Mac?

    I have had a Dual Core MacBook Pro since last July, but I have never run Windows on it. Could someone here please explain to me how I can run Windows on my Mac, how to switch between Windows and Mac OSX, and if Windows Vista is able to be run on a Mac. Or, at least point me in an article already posted on this subject. Thank you!
    MacBook Pro   Mac OS X (10.4.8)   17" Screen, 2.16 GHz Processor, 1 GB RAM, 120 GB Hard Drive

    Please search the discussions before posting. You'll find hundreds of threads detailing how to run Windows on a Mac and could have answered your own question. Or better yet, just search Google.
    http://www.apple.com/macosx/bootcamp/

Maybe you are looking for

  • ColdFusion 11: cfclient seems to require /CFIDE to be available

    G'day: I am reposting this from my blog ("ColdFusion 11: <cfclient> seems to require /CFIDE to be available") at the suggestion of Adobe support: @dacCfml @ColdFusion Can you post your queries at http://t.co/8UF4uCajTC for all cfclient and mobile que

  • How to INclude TEXT MOdule created in SForm?

    How to INclude TExt Module created in Samrt forms into a text node...? PLease explain.....ANy suggestions will be appreciated... REgards, Kittu

  • Namespace ns0 generated in each node and field.

    Hi EveryBody, I have a file to file scenario in which i am using XSDs for both source and target. Below is my target payload generated: ?xml version="1.0" encoding="UTF-8"?> <ns0:Business xmlns:ns0="http://www.xyz.com/schemas">   <ns0:Header>     <ns

  • Navigation link for an existing view

    I am currently using CRM 5.0.  In CRM 5.0 how we can set up new navigation link for an existing view or view set.

  • Cannot Print, no pages were selected to print!

    Hi, I've seen this error message in a lot of discussions online but yet I haven't been able to solve it. I'm running adobe reader XI (11.0.0). When I print some PDF documents i get the error stating that "no pages were selected to print". When I look