• 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: AS Library Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AS Library Question


  • Subject: Re: AS Library Question
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 03 Dec 2015 00:37:56 +0100

> Le 2 déc. 2015 à 23:01, Stan Cleveland a écrit :
>
> Hi all,
>
> […]
>
> Further testing shows this works within a self-contained script, no library needed:
> 	on stripWhiteSpace(str)
> 		-- removes leading and trailing whitespace
> 		do shell script ("ruby -e \"puts('" & str & "'.strip)\"")
> 	end stripWhiteSpace
> 	stripWhiteSpace
> 	-- Script Editor result -->
> 		«handler stripWhiteSpace»
>
> Right off, I can’t think of any ways to utilize this, but maybe it could be useful. Any thoughts?

Hello Stan,

One may expand it further as:

	on foo(s)
		display dialog s
	end foo
	set bar to foo
	bar("Hello!")

Handlers are kind of properties, in the above example properties of the top level script.


> I’ve looked in vain for this in the documentation, but if I’ve simply missed it, I apologize for the unnecessary noise.

IIRC, this is (at least implicitly) described in the ASLG.
But probably needing to put several disparate pieces together…

HTH,
Axel



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Prev by Date: Re: AS Library Question
  • Next by Date: Explorer 4 is inserting 'rich text' in El Capitan Mail script
  • Previous by thread: Re: AS Library Question
  • Next by thread: Re: AS Library Question
  • Index(es):
    • Date
    • Thread