• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Now is: Finder tell block (using >1 handler)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Now is: Finder tell block (using >1 handler)


  • Subject: Re: Now is: Finder tell block (using >1 handler)
  • From: has <email@hidden>
  • Date: Tue, 5 Mar 2002 21:20:04 +0000

Robert Kyle wrote:

>Forgive me if this issue has already been addressed, but I'm wondering if
>using a handler offers any relief to the dangers of nested tell blocks. In
>other words:
>
>on doQuarkStuff()
>tell application "QuarkXpress" to do something clever
>end tell
>end doQuarkStuff
>
>tell application "Finder"
>if (get something important) is true then
>my doQuarkStuff()
>end if
>end tell
>
>Obviously, this bogus script could easily be flattened out. But sometimes
>you're deep in a tell block to one application and then need to find out
>something from another. In such a case, is there any advantage to using a
>handler?

I think the real advantage of the design you just outlined is that it makes
for code that's more modular, more readable and easier to maintain. I
believe this sort of thing is broadly encouraged in the world of "Real
Programming", while the single all-purpose, hundred-line spaghetti handler
is generally frowned upon (not least because it's non-modular, harder to
read and more difficult to maintain).

[Just a side thought...]

Cheers,

has
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: How to delete text items?
  • Next by Date: Booleans in AS
  • Previous by thread: Scripting Photoshop 7
  • Next by thread: Booleans in AS
  • Index(es):
    • Date
    • Thread