AppleScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • french frank
    Administrator/Moderator
    • Feb 2007
    • 30448

    AppleScript

    I've just discovered this If I follow the instructions but make a mistake, could it make my computer instantly useless? IOW is it a dangerous tool that amateurs shouldn't mess with or is it idiot-proof?

    [What I'm trying to do is write a script (which I have) that will let me select multiple emails and send them the identical reply in one go without having to send the same message out x times]
    It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.
  • french frank
    Administrator/Moderator
    • Feb 2007
    • 30448

    #2
    So, one of my more popular threads - 19 views and no answers. To put it a different way, does anyone use AppleScript to add special functions to any programs?
    It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.

    Comment

    • Dave2002
      Full Member
      • Dec 2010
      • 18034

      #3
      I think there are some users out there, but probably aa a proportion of the total number of Apple users, the number is small.
      I think Apple also changed it from time to time, with different versions of the OS - which had the effect of alerting me to the fact that there are users - as some were rather irritated by the changes.

      I think if there is something significant which you want to do, and which would otherwise require a lot of manual effort, it could be very useful. I doubt that it is either idiot proof, or on the other hand, incredibly dangerous - if used sensibly. Of course if you will program Disk Utiity to reformat all the disks in your system ......

      If you want to try, and are uncertain, I'd suggest making sure you have a backup or two of your system first - just in case. Don't leave the backup drives connected. Chances are nothing untoward will happen.

      Do you have a practical potential application?

      Comment

      • french frank
        Administrator/Moderator
        • Feb 2007
        • 30448

        #4
        Originally posted by Dave2002 View Post
        Do you have a practical potential application?
        Yes - what I said in the OP!

        I have started the AS tutorial and can see that you can introduce an immediate command, but then delete the AS text once the action has been performed. Some people asking online have wanted to reply to a group of 100+ with the identical message, but I only had 15 this time, so have just sent out the emails in a bcc'd batch - but it means extracting each separate address manually first

        I'm not sure whether just creating a temporary group is just as quick for that (though that only works once, as the next group will be different people) or whether you save your first script and apply it to each new group. Lot of language to learn …
        It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.

        Comment

        • Anastasius
          Full Member
          • Mar 2015
          • 1860

          #5
          Fear not, FF. I don't think that you are in any danger of wrecking your Mac.

          Would it not be easier to create Groups in Address Book?
          Fewer Smart things. More smart people.

          Comment

          • french frank
            Administrator/Moderator
            • Feb 2007
            • 30448

            #6
            Originally posted by Anastasius View Post
            Would it not be easier to create Groups in Address Book?
            Yes, that's what I thought in terms of the amount of time involved. The group numbers are unlikely to involve more than, say, 20 each time. I'm busy doing major domestic decluttering and advertising on Freecycle: the last Offer got 16 replies. But when I get on to the silver, antiques and works of art …

            I was just curious when I looked to see if there was a way to do it and discovered … AppleScript - which I'd never heard of - was on my computer. I felt impelled to investigate in the endless search for truth.
            It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.

            Comment

            • Dave2002
              Full Member
              • Dec 2010
              • 18034

              #7
              Does this AS code help,you at all?



              I"m not guaranteeing it will!

              Comment

              • french frank
                Administrator/Moderator
                • Feb 2007
                • 30448

                #8
                Originally posted by Dave2002 View Post
                Does this AS code help,you at all?



                I"m not guaranteeing it will!


                Well, it does seem only to have been rated at 2 ¼ stars out of 5 - that's my excuse
                It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.

                Comment

                • Dave2002
                  Full Member
                  • Dec 2010
                  • 18034

                  #9
                  I'm now wondering how simple or otherwise it would be to toggle the energy saving parameters using AS. Sometimes one desires to keep things going without slacking. Trivial, but potentially useful.

                  Comment

                  • Dave2002
                    Full Member
                    • Dec 2010
                    • 18034

                    #10
                    I juat found this, in a manual for Quicktime Pro - though I suspect that few people use that now, if indeed they ever did -
                    Automating QuickTime Player with AppleScript
                    In Mac OS X, you can use AppleScript to automate QuickTime Player functions. For example, you can open a movie and tell it to play for a specific duration; automate the conversion of movies from one format to another; adjust track playback properties such as start time, volume, and layer; or adjust movie properties such as copyright and author.
                    To determine all of the AppleScript commands you can use to control QuickTime Player, install AppleScript and look at the QuickTime Player AppleScript dictionary.
                    1 Open Script Editor.
                    2 Choose File > Open Dictionary.
                    3 Select QuickTime Player.
                    Sample QuickTime Player scripts can be found on the AppleScript website (www.apple.com/applescript/quicktime).
                    This is followed by an indication of how to do similar things in Windows:

                    Automating QuickTime Player on Windows
                    In Windows, you can use JavaScript, Visual Basic, or other Active Scripting languages to automate QuickTime Player functions. As with AppleScript on Mac OS X, you can control movie playback, convert movies from one format to another, adjust movie and track properties, and more.

                    Comment

                    • Dave2002
                      Full Member
                      • Dec 2010
                      • 18034

                      #11
                      This morning I was trying to do some simple benchmarking, armed with a stopwatch. I kinda succeeded, though there's probably up to a one second error, which is between 5 and 10 percent given the length of operations. Afterwards it struck me that I should have got the computer to do the timing, which is what I used to do years ago. Indeed, in those days I would hardly have thought of doing otherwise.

                      Not sure if that is possible/easy with AppleScript, but it should be. On the other hand, for what I was trying to do, it might be simpler to go into Unix mode, via the Terminal interface,
                      and write a few scripts there to automate the benchmarking. There probably wouldn't be such a big difference in the OS modes (OS X vs Unix) to invalidate the transfer timing results.

                      All I was doing was transferring one fairly large file to and from different drives via different interfaces to see which gave the best results.

                      I also found this possibly useful article on AppleScript - https://www.smashingmagazine.com/200...r-life-easier/ for anyone who might still be interested.

                      Re my own benchmarking - crude and simple so far, on a uni-directional file transfer from a machine which has Firewire 800 and USB 2, Firewire to a hard drive is about 50% faster than USB 2 to an SSD. That's in both directions, which have comparable data rates. Firewire might go even faster if files are transferred in both directions, as it is a full duplex link. Also curiously, copy to an external Firewire drive is faster than doing an internal file duplication on the iMac's main hard drive.

                      Testing out bi-directional near simultaneous transfers probably will take a script, for several reasons - 1. to get the protocols right, 2. to get the timings, and 3. to develop an efficient method for multiple file transfers.

                      Also, once the scripts have been developed, it should be possible to transfer them to other machines, and compare results there. I do want to check out the timings on my USB 3 enabled MBP later on with the same drives. I also want to replace the caddy for the SSD, so I can test it using Firewire - since the new multi-interface standard caddy arrived recently.

                      One other script (AppleScript) which could be very useful for me right now, is one to reduce the effective file size of a folder containing photos - do each photo with the same compression process - so I can send them via email.
                      I know it's possible with various photo editing tools, or other apps, but immediately I don't know how to do it other than by a one by one process, which would be tedious. I don't want to lose the originals, but I do want manageable copies which I could then select to send via email.

                      Comment

                      Working...
                      X