Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Automator! It's simultaneously awesome and horrible. It has many powers and quirks. Here are some notes on functionality and issues to watch out for:

If you can't see code: Close the Library.

If you can't see Library items: Click "hide description" icon bottom left (or resize its frame).

The Hammer Icon checks syntax and indents your code (if syntax passed). It also does odd things sometimes like rename all instances of a particular uppercase variable to lowercase (but only some variables).

Debug Applescript with try blocks that propogate the error:

try something on error oops # <- oops is my pet name for the error msg :-) display alert oops as critical # let's see wtf display alert MyData # examine some data structure #return # maybe exit too, while debugging end try
Debug Perl the usual ways but, I have to mention something WEIRD about shell. It seems like an Automator bug but who knows. Sometimes the code inside a do shell script stops working for no apparent reason. Nothing is wrong with the previously working code, it was not changed, and it does not work. The solution to this crazy problem is equally crazy: erase the problem code and rewrite the do shell script part by actually typing, then paste your Perl back into place.

Automator has a spectacular built-in Time Machine (that every program should have)! You can restore any version of the file. It's simply magnificent.

Be very careful about using the Play button to test scripts. If you have an infinite loop it can get stranded. You may be able to break out with dot (Command .) or you may have to kill Automator. Luckily the revision system means you'll lose never lose data if it crashes or gets killed. It usually works fine but when Automator crashes on me it's always when going back through multiple levels of undo (Command Z). That crash can be ignored but you have to restart the program to fix undo.

Background apps made with Automator get a cool free animated gear icon in the system menubar! Click the gear to exit or, in some cases, monitor its progress. Love your Gear!

In reply to Re: How to write apps for macOS/OSX in Perl! by Anonymous Monk
in thread How to write apps for macOS/OSX in Perl! by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (7)
    As of 2020-01-23 10:35 GMT
    Find Nodes?
      Voting Booth?