How Do I get the Default App?
I found this, which looks like a solution, but requires ASObjC:
Launch Services Concepts
In addition, some Launch Services functions apply not to specific individual items but to families of items defined by certain identifying characteristics. These characteristics can include:
A four-character file type code
A four-character creator signature
A filename extension
A MIME (Multipurpose Internet Mail Extension) type
For instance, the Launch Services function LSGetApplicationForInfo finds the preferred application for a family of documents defined by their file type, creator signature, filename extension, or any combination of these characteristics; the LSCopyApplicationForMIMEType function finds the preferred application for items with a specified MIME type.
My immediate need is for a “scpt” file. I want to open the default script editor, but I don’t actually have a file, just the text.
So, can anyone help me with the ASObjC to do this?
Well there are 3 great solutions in this thread. I picked the one by @ionah as the “official” solution since, IMO, it provides the best handler. My sincere thanks to all of you. This has been very helpful.
ASObjC solution by Shane
Shell Perl Solution by Chris
ASObjC Handler by @ionah Based on Shane’s Script