returning
returning
- Subject: returning
- From: Nelson Byrne <email@hidden>
- Date: Sat, 12 Jul 2014 15:41:17 -0700
For years I have used "returning" in my scripts. It works like the RIGHT DOUBLE ARROW of old, like so:
------------
count someList returning theCount
---- or
x*5 returning y
------------
Neuburg's excellent "Definitive Guide" tells us that "returning" is a synonym of "set", with the arguments reversed.
Last November's Applescript Language Guide says "returning" is "deprecated", so I'd like to get rid of it.
I wrote a program to process my scripts using the rule
REPLACE [A RETURNING B] WITH [SET B TO A].
This generally works OK, but it fails on stuff like:
------------
tell application "Finder" to (make new file at theOutput with properties {name:"mylog"}) as alias returning theLogFile
---- or
tell application "Finder" to get (files of theFolder where name of it ends with ".jpg") as alias list returning theJpgList
------------
Perhaps I could test for this sort of command (what sort exactly? I don't know.) and use this rule:
REPLACE [A RETURNING B] WITH [A (newline) SET B TO RESULT]
Maybe I could skip the doubtful test and just do it for all statements.
Comments? Help?
_______________________________________________
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