Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2023-02-01 09:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found