FiScript icon indicating copy to clipboard operation
FiScript copied to clipboard

FiScript can only detect itself when in `/Applications/`

Open wildwestrom opened this issue 4 years ago • 3 comments

I'm not sure if this is true, but it seems like the path to FiScript is hardcoded to /Applications/FiScript.app/Contents/PlugIns/FiScriptHelper.app. Here's the error message:

Can't communicate with helper application.

Check if Helper applications exists at /Applications/FiScript.app/Contents/PlugIns/FiScriptHelper.app Helper application has been moved or deleted. Please move the helper application back or reinstall FiScript.

This is a problem, because by default I set Homebrew to install everything in ~/Applications/.

wildwestrom avatar Aug 23 '21 23:08 wildwestrom

Correct, it is hardcoded:

https://github.com/Mortennn/FiScript/blob/4f2175b356314f7fe0b4397deb064e839ba53a07/Common/HelperFunctions.swift#L17

gingerbeardman avatar Aug 24 '21 00:08 gingerbeardman

Ok, how difficult might it be to detect the Application path and add the helper file? I would like to help but I don't know swift or the apple APIs at all.

Edit: I tried using Bundle.main.resourceURL in the swift repl, but it returns an error: $R8: URL? = Failed to get the 'some' field from optional '$R8' No idea how to begin to debug that.

wildwestrom avatar Aug 24 '21 00:08 wildwestrom

I'm not sure, I'll have to defer to @Mortennn

gingerbeardman avatar Aug 24 '21 00:08 gingerbeardman