Re: Trying to move away from Finder...

Jean-Christophe Helary <jean.christophe.helary@...>

Well, that was definitely time well spent on my side, and thank you *very much* for the thorough reply.
This is going to become a very colorful blog post... :-)

I guess it will take me a bit more time to be able to read ASOC and make sens of everything, as for *writing* it I have no idea... But well, there is a start to everything.

Now, I think you wrote about that in a different thread, but I'm not sure, it is about the scope of ASOC as an automation tool. Is it better to see it as a replacement for System Events/Scripting Additions, ie, faceless code that glues things together between applications, and use standard AS for accessing the application's automation features, is that correct ?

I'm going back to work now, it'll take some time to process all that.


On Nov 2, 2017, at 14:29, Shane Stanley <sstanley@...> wrote:

On 2 Nov 2017, at 3:50 pm, Jean-Christophe Helary <jean.christophe.helary@...> wrote:

set default_location_url to current application's |NSURL|'s fileURLWithPath:default_location

It looks like you are calling a handler (fileURLWithPath) that belongs to whatever |NSURL| is (are the || required ?) and that "|NSURL|" belongs to "current application", with the parameter default_location.

Checking the Foundation documentation, I find that fileURLWithPath is a "Type Method" for the "NSURL" class. Is it the same "|NSURL|" as above?

The pipes around NSURL are used because there's a terminology clash with a fairly common scripting addition that unfortunately uses the Cocoa class name. Preceding it by "current application's " is just the way to refer to a Cocoa class. The term "type method" is a relatively new Swiftian thing -- these were traditionally called "class methods", because the target of them is the class itself (as opposed to "instance methods", which are targeted at instances of the class).

Jean-Christophe Helary

Join to automatically receive all group messages.