How to create 'proxy' application for another app?

I want to create an application that does nothing, except 'hand-over' to another application. So double-clicking on the app launches another app; and double-clicking on the app's files opens them in the other app.

Why? Because I want to set custom file icons to a particular file type. So I'm using a dummy app as the 'default' app for the file type, before handing to the real app.

In Mojave, I can do this: create a boilerplate application in Xcode, add the document type and icons; then switch out the app's binary for a hard link to the binary of the app I want.

However, this doesn't work on Catalina , for 'security reasons'. <rolls eyes> I even tried re-signing my app with the hard link in the bundle, but that still doesn't work. The app just crashes on launch.

Is there another way that I can do this? Or are such things forbidden?

I've tried creating an Automator or AppleScript application that just opens the target app, passing the documents to it, but I can't work out how to modify the Info.plist without getting a 'No Entry' sign on the app.

PS: How do you browse through these forums? I'll be amazed if anyone reads this.
Answered by DTS Engineer in 624143022
Probably the easiest option is to use an AppleScript. Develop and test the code in Script Editor and then save it as an application. When you want to clone this to create a unique app:
  1. Make a copy.

  2. Modify the Info.plist to give it a new bundle ID and claim the documents you care about.

  3. Sign that copy.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

I'll be amazed if anyone reads this.

Prepare to be amazed!

How do you browse through these forums?

For the tags I care about I bookmark the associated tag page (for example, if you search for [Security] you’ll land on the Security tag page). That gives me a list of threads with that tag, with the most recent threads first.

Clearly this is less than ideal for the casual user. Rest assured that the folks working on the DevForums platform understand the desire for improved navigation tools (-:



then switch out the app's binary for a hard link to the binary of the app I want.

Well, that’s not going to work. The problem here is that the code signature for an app is stored in the app’s executable but the code signature seals over the app’s resources. When you “switch out” the executable you end up with a new code signature associated with the original resources. That breaks the seal on the code signature, which doesn’t end well.

What is your deployment model here? Are you building this for yourself? Or do you plan to ship this to a wide range of users?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Quinn, thanks for your reply.

Yes, I'm just building this for myself, but ideally I'd like to produce something that others can follow the steps of.

Can you think of a better way of achieving the end result? As said, I tried AppleScript applications, but editing the Info.plist would always break the app. (No Entry sign.)
Accepted Answer
Probably the easiest option is to use an AppleScript. Develop and test the code in Script Editor and then save it as an application. When you want to clone this to create a unique app:
  1. Make a copy.

  2. Modify the Info.plist to give it a new bundle ID and claim the documents you care about.

  3. Sign that copy.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
How to create 'proxy' application for another app?
 
 
Q