Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling the executable directly, not from the workflow #38

Open
Madd0g opened this issue Aug 31, 2022 · 1 comment
Open

Calling the executable directly, not from the workflow #38

Madd0g opened this issue Aug 31, 2022 · 1 comment

Comments

@Madd0g
Copy link

Madd0g commented Aug 31, 2022

I created a copy of the server.sh file that runs the executable directly.

#!/bin/zsh

# This script is a wrapper for the Firefox extension client/RPC server
# to set an Alfred-like environment when it is run by Firefox.

here="${${(%):-%x}:A:h}"

# getvar <name> | Read a value from info.plist
getvar() {
    local v="$1"
    /usr/libexec/PlistBuddy -c "Print :$v" "${here}/info.plist"
}

export alfred_workflow_bundleid=$( getvar "bundleid" )
export alfred_workflow_version=$( getvar "version" )
export alfred_workflow_name=$( getvar "name" )
export alfred_debug=0 # <---- 

export alfred_workflow_cache="${HOME}/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/${alfred_workflow_bundleid}"
export alfred_workflow_data="${HOME}/Library/Application Support/Alfred/Workflow Data/${alfred_workflow_bundleid}"

mkdir -p "${alfred_workflow_data}"
mkdir -p "${alfred_workflow_cache}"

exec "${here}/alfred-firefox" $1 $2 $3 $4 $5

I'm getting results back in the terminal, but there are lots of log messages, like:

>  ./run.sh tab-info
01:06:29 ----- Firefox Assistant/0.2.2 (AwGo/0.27.1) ------
01:06:29 loaded URL action "Open in Default Application" from .....
01:16:34 RPC client connected to "Firefox"
{"alfredworkflow":{"variables":{"FF_INDEX":"1","FF_TAB":"2","FF_TITLE":"New Issue ......
01:19:10 ------------------- 4.672601ms -------------------

Is there a way to get just the JSON response back, without the extra log messages?
I tried setting the alfred_debug variable to 0, don't know if it's related

Thanks

@luutuankiet
Copy link

luutuankiet commented Nov 20, 2024

hi, I just recently came across this and found a workaround. You'd want to write the output to a file, which somehow would get only the contents : ./run.sh tab-info > tmp.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants