11 Replies Latest reply on Oct 4, 2010 2:46 PM by sstanleyau

    Applescript > ScriptUI or Flex (hesitations)

    Loic.Aigon Adobe Community Professional

      Hi Guys,

       

      I wrote applescript scripts that my customer is happy with. We chose applescript as the script was aimed to work with QuarkXpress and Indesign on mac platforms.

       

      But as native applescript is quite limited in the interface area, they want to turn into Javascript extended abilities regarding to Interface Creation. I am ok with that. The only concern I have is that the Applescript codes were executing system operations such as zipping/unzipping, http connections (curl in a do shell script), remove files...

       

      I know you can execute applescript with javascript and doScript (in a mac environment of course) and I have to run some tests. However, as I want to dig with Flex as much as possible from now, I thought I could use it instead of ScriptUI.

       

      BUT whatever I use ScriptUI or Flex, I have no certitudes that they will do what I need them to do like I explained above. Do you have any feedback on this topic ? Is one of these technologies more appropriate ? Maybe none of these can do the trick ?

       

      Any advice would be welcome.

       

      Loic

        • 1. Re: Applescript > ScriptUI or Flex (hesitations)
          sstanleyau Level 4

          I can't answer for Flex or ScriptUI, but there is one other alternative: AppleScriptObjC. It's Snow Leopard only, but it effectively gives you access to most of Cocoa from AppleScript. Just another option to consider...

          1 person found this helpful
          • 2. Re: Applescript > ScriptUI or Flex (hesitations)
            Loic.Aigon Adobe Community Professional

            Hi Shane,

             

            Thx a lot for your answer. I considered working with applescript studio but it seems that it implies the "script" becomes an external software that can't be launched as an internal plugin like standard applescript (or js/flex) does. I don't know if AppleScriptObjC is the same as APS or another technology that could offer this internal use I need.

            I will have a look.

             

            Thx a lot anyway.

             

            Loic

            • 3. Re: Applescript > ScriptUI or Flex (hesitations)
              Harbs. Level 6

              Why can't you call the "external app" from within InDesign?

               

              Flex is very nice, but it's CS5 only.


              You can call AppleScript from Flex as well either using doScript or NativeProcess.

               

              Harbs

              1 person found this helpful
              • 4. Re: Applescript > ScriptUI or Flex (hesitations)
                Loic.Aigon Adobe Community Professional

                Hi Harbs,

                 

                Thanks a lot for your help !

                Why can't you call the "external app" from within InDesign?

                Do you mean writing an applescript snippet that will execute the external app ?

                 

                Just curious, when you say it's cs5 only, Flex 3 and cs4.swc allowed us to make swf panels for CS4 (and even cs3), or is it the ability to call doScript (or native processes as you offer) that is cs5 only ?

                 

                If Flex allows calling applescript, that's a great lead for me.

                 

                Thanks a lot.

                 

                Loic

                • 5. Re: Applescript > ScriptUI or Flex (hesitations)
                  Harbs. Level 6

                  Do you mean writing an applescript snippet that will execute the external app ?

                   

                  No. You can execute compiled AppleScripts from the Scripts Panel.

                   

                  PatchPanel was not exactly release quality software and Adobe no longer even offers it for download... If it serves your purposes, by all means use it!

                   

                  I think doScript() will work in PatchPanel, but NativeProcess will not (it's an AIR 2.0 API). Also, anything you can't do directly in ActionScript, you can always do in ExtendScript and call that from the ActionScript...

                   

                  Harbs

                  • 6. Re: Applescript > ScriptUI or Flex (hesitations)
                    Loic.Aigon Adobe Community Professional

                    Hi and thanks a lot Shane and Harbs for your helpful answers,

                     

                    Ok, I have now great material and indications to dig further.

                     

                    One last thing Harbs, I was told Applescript studio project couldn't be ran from Indesign.

                    http://macscripter.net/viewtopic.php?id=34296

                     

                    Because the main problem is that teh customer wants some widgets that standard Applescript can't offer (Dropdowns, checkbox...). So Applescript Studio looked like the solution but it seemed like it could be only used as an external software.

                     

                    Loic

                    • 7. Re: Applescript > ScriptUI or Flex (hesitations)
                      sstanleyau Level 4

                      I'm not sure what you mean by an "external software". AppleScript Studio is deprecated in favor of AppleScriptObjC, but both produce standalone applications. In practical terms, I'm not sure that's any great disadvantage; do script gives much the same speed anyway, and even without do script, AppleScriptObjC apps run code at close to the speed of those run from the Scripts panel, in my experience -- certainly much faster than a normal AppleScript app.

                      • 8. Re: Applescript > ScriptUI or Flex (hesitations)
                        Loic.Aigon Adobe Community Professional

                        Hi Shane,

                         

                        Yeah sorry if I am confused, I don't handle applescript beyond basic language. So what you tell me is that I can create a complex interface with AppleScriptObjC and then get a compiled script that I can run from indesign like I would with a basic applescript code ? Maybe it's what Harbs tried to tell me and I didn't understand it. Let me know if I am right.

                         

                        Thanks in advance.

                         

                        Loic

                        • 9. Re: Applescript > ScriptUI or Flex (hesitations)
                          Harbs. Level 6

                          I've never created one myself, but for a long time I used a pdf placer script from Exchange with an advanced dialog saved as an app, built in AppleScript Studio. It ran from the Script Dialog very nicely...

                           

                          I'd give you the link to the script, but Exchange seems to be down...

                           

                          Harbs

                          • 10. Re: Applescript > ScriptUI or Flex (hesitations)
                            Loic.Aigon Adobe Community Professional

                            Ok,

                             

                            Then it sounds perfect to me. I now have to study the learning curve for AppleScriptObjC compared to Flex.

                             

                            Thanks so much to both of you for your help on my questions,

                             

                            Loic

                            • 11. Re: Applescript > ScriptUI or Flex (hesitations)
                              sstanleyau Level 4
                              So what you tell me is that I can create a complex interface with AppleScriptObjC and then get a compiled script that I can run from indesign like I would with a basic applescript code ?

                              You don't run it *from* InDesign -- there's no need.