12 Replies Latest reply on Apr 26, 2012 5:41 PM by StanMillar

    Shell scripting on a Mac to get data into FM container from Apple Mail

    StanMillar

      Hi all

       

      I have been told by the local Apple reseller that AppleScript is to be deprecated in upcoming versions of Mac OSX in favour of ObjectiveC.

       

      This being the case, the AppleScripts that I have laboriously sweated through (learning as I go and shamelessly plagiarising scripts found on the web) will no longer work.

       

      One of these I use with my scanner to run a shell script and I can probably modify the code to bypass AppleScript. However...

       

      I was in the process of (partially successfully) defining an AppleScript to extract a PDF attachment from a Mail message, move it to an external location over a network, rename it and insert as a reference into an FM container field. This location is variable and is defined by data extracted from FileMaker.

       

      It now seems that I have to try to learn ObjectiveC, about which I know less than nothing, or throw myself on the mercy of those many, who are much more learned than myself, to define the required shell script.

       

      This latter greatly appeals to me because I am basically lazy and therefore would be willing to pay someone to do all the hard work for me!! (Actually, it's because I cannot get my head around any of the shell scripts that I have looked at.)

       

      There are complexities to this that I can explain in more detail if I have any takers, not because they are difficult, but because they are convoluted.

       

      Any suggestions?

       

      Thanks all.

        • 1. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
          sporobolus

          on 2012-04-24 24:45 StanMillar wrote

          I have been told by the local Apple reseller that AppleScript is to be

          deprecated in upcoming versions of Mac OSX in favour of ObjectiveC.

           

          it's not clear to me that this is fact, but even if it were, deprecated does

          not mean gone; would it be sufficient if your AppleScript solution were to work

          for three or four years? then i think you'll be alright, though you may need

          some maintenance as new versions of Mail and FileMaker come out; i would

          consider an alternative approach when/if the end of AppleScript is formally

          announced (or when FileMaker or Mail stop supporting it)

           

           

          I was in the process of (partially successfully) defining an AppleScript to

          extract a PDF attachment from a Mail message, move it to an external location

          over a network, rename it and insert as a reference into an FM container field.

          This location is variable and is defined by data extracted from FileMaker.

           

          It now seems that I have to try to learn ObjectiveC, about which I know less

          than nothing, or throw myself on the mercy of those many, who are much more

          learned than myself, to define the required shell script.

           

          while you could indeed write some Objective C code that sent appropriate Apple

          Events to Mail and FileMaker, for most people (me included) this would be much

          more work than using AppleScript and possibly adjunct shell scripts; it also

          sounds like you may be confusing Objective C with shell scripts — they are not

          at all the same

           

          what you describe — extract PDF from message, move/copy to dynamic location,

          add to FileMaker container — is not an especially hard task with AppleScript,

          but it can be fussy to solve such tasks robustly

          • 2. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
            StanMillar

            Steve

             

            Thanks for your reply.

             

            I know that ObjectiveC and shell scripting are different, but that about sums up my knowledge of the two.

             

            Are you interested in off-list discussions?

             

            It's a national holiday here in Australia today remembering our war fallen (ANZAC Day), so I may not be on line most of the day.

            • 3. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
              ariley

              No need to coplicate your life, Stan. I doubt AppleScript will go away soon, and Objective C is not a programming language that is equivalent. Plus to learn that you'd need to sort of learn C first. 

               

              If I understand you right, what you're trying to do you can easily do with the Mail-it and SuperContainer plug-ins. I've actually done basically just that: took and email attachment and used SuperContainer to load it onto a file server, then display it in a web viewer in FM. 

               

              agnes b. riley . filemaker and web development

              FileMaker Business Alliance . FileMaker Technical Network

              www.zerobluetech.com (http://www.zerobluetech.com)

               

               

              T 201-299-6223 (NJ) .

              212-842-8830 (NY)

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

              .

              917-660-7221 (C)

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

              FileMaker Certified in 10 and 11

              people + products + events + todos + invoices + documents = productivity

              1 of 1 people found this helpful
              • 4. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                TonyWhite

                I highly doubt that Apple is going to take away AppleScript anytime in the

                next 10 years, if ever. Doing so would destroy one of Apple¹s key

                competitive advantages and damage the entire Macintosh ecosystem.

                 

                AppleScript Studio is being depreciated in favor of AppleScriptObjC

                http://www.macosxautomation.com/applescript/apps/index.html

                 

                Perhaps that is what the local Apple reseller was thinking of.

                 

                The link above provides evidence that Apple is investing in AppleScript and

                Objective C.

                 

                All the best,

                 

                 

                Tony White

                Tony White Designs, Inc.

                Tel: 718-797-4175

                tony_white@twdesigns.com

                http://www.twdesigns.com

                1 of 1 people found this helpful
                • 5. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                  sporobolus

                  on 2012-04-24 21:52 ariley wrote

                  If I understand you right, what you're trying to do you can easily do with the Mail-it and SuperContainer plug-ins. I've actually done basically just that: took and email attachment and used SuperContainer to load it onto a file server, then display it in a web viewer in FM.

                   

                  that's a good point that plug-ins are available for some of the more common

                  tasks AppleScript might be used for, and they can hide some of the parts that

                  are confusing for many people (such as different path formats)

                   

                  i tend to avoid plug-ins, but though i am very skilled with AppleScript & shell

                  scripts, finding solutions can still be complicated

                  • 6. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                    ariley

                    If there's a solution out there that does what you need, why would you want to write your own and waste your time on it? My time is better spend creating solutions that are not readily available. 

                     

                    PS: There's nothing wrong with plug-ins. 

                     

                    agnes b. riley . filemaker and web development

                    FileMaker Business Alliance . FileMaker Technical Network

                    www.zerobluetech.com (http://www.zerobluetech.com)

                     

                     

                    T 201-299-6223 (NJ) .

                    212-842-8830 (NY)

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    .

                    917-660-7221 (C)

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    FileMaker Certified in 10 and 11

                    people + products + events + todos + invoices + documents = productivity

                    • 7. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                      sporobolus

                      on 2012-04-24 23:57 TonyWhite wrote

                      I highly doubt that Apple is going to take away AppleScript anytime in the

                      next 10 years, if ever. Doing so would destroy one of Apple¹s key

                      competitive advantages and damage the entire Macintosh ecosystem.

                       

                      i don't think it's going away, but i do think the realms where AppleScript

                      matters are a drop in the bucket to Apple and AppleScript will be perpetually

                      under-resourced

                      • 8. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                        StanMillar

                        Tony

                         

                        Thanks for that info.

                         

                        I'll pass it on.

                         

                        Stan

                        Stan Millar

                        Director

                        Bromac Business Services Pty Ltd

                        Loan Administration

                        w: http://www.bromac.com.au/

                        e: <stan@bromac.com.au>

                        P: +61 7 3397 9998

                        F: +61 7 3910 1092

                        National Secretary

                        Finance Brokers Association of Australia

                        Secretary

                        TFP Co-operative Limited

                        • 9. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                          sporobolus

                          on 2012-04-25 14:41 ariley wrote

                          If there's a solution out there that does what you need, why would you want to write your own and waste your time on it? My time is better spend creating solutions that are not readily available.

                           

                          well, i'm not into "wasting time", but my definition might differ from yours,

                          in part because AppleScript and related tools are a big part of my consulting

                          practice

                           

                          i'll use a plug-in when it's the best path by a good margin, or where it's the

                          only way; i use plug-ins in publishing (e.g. XTags & EmData) and in Drupal work

                          (where plugin-like modules are the bread and butter of getting things done)

                           

                          but for me with FileMaker the "solution out there that does what i need" may be

                          an AppleScript already partly or wholly composed by me or someone else; it may

                          or may not save time over a plug-in, but it's often a pittance either way, and

                          meanwhile i keep up my AppleScript and shell scripting chops

                           

                          i may also need to hook multiple applications together. or a manager may not be

                          able to grok the savings "extra" tools will produce; there are lots of reasons,

                          but i admit to not being purely objective about it — i may just prefer familiar

                          arcana to those of a plug-in

                          • 10. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                            fentonjones

                            Another good site for AppleScript data, of various types is:

                             

                            http://www.MacScripter.net/

                             

                            I used to spend some time messing about with AppleScript and Shell scripting. I sometimes used them together, generally within an AppleScript, which could then be run as is, or from within a FileMaker script. In other words, I prefered to write it within AS, to hold the basic code and objects, but sometimes used shell within the AS to do things that it does faster, and usually faster (much).

                             

                            Another tool, which is more like you were talking about, is: AppleScriptObjC and Xcode, one of the forums at the above site.

                             

                            I don't know to use it at all. And, for the last month I haven’t down anothing much on anything. I had a stroke a bit more than a year ago, so I'm no longer doing much. But I do remember where some of the information can be found :-]

                            • 11. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                              ariley

                              Also, Justin's site www.veritrope.com (http://veritrope.com/tech/applescript-automator-resources/) is a good resource for AppleScript. He will even write you code if needed. 

                               

                              Best regards, 

                               

                              agnes b. riley . filemaker and web development

                              FileMaker Business Alliance . FileMaker Technical Network

                              www.zerobluetech.com (http://www.zerobluetech.com)

                               

                               

                              T 201-299-6223 (NJ) .

                              212-842-8830 (NY)

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                              .

                              917-660-7221 (C)

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                               

                              FileMaker Certified in 10 and 11

                              people + products + events + todos + invoices + documents = productivity

                              • 12. Re: Shell scripting on a Mac to get data into FM container from Apple Mail
                                StanMillar

                                Thanks Agnes

                                 

                                I'll have a look.

                                 

                                Stan

                                Stan Millar

                                Director

                                Bromac Business Services Pty Ltd

                                Loan Administration

                                w: http://www.bromac.com.au/

                                e: <stan@bromac.com.au>

                                P: +61 7 3397 9998

                                F: +61 7 3910 1092

                                National Secretary

                                Finance Brokers Association of Australia

                                Secretary

                                TFP Co-operative Limited