Jump to content

Recommended Posts

53 minutes ago, deanishe said:

 

Read the thread. The solution is three posts above yours.

 

Read it again. Not a fully working solution.

 

EDIT: Also, I did try that. Not working for me still. 

 

EDIT2: When I said not working, I meant, the PHP error code doesn't pop up anymore, but nothing related to Calculate Anything comes up now when I type "CA". 

image.thumb.png.f72f45975e1ed061a80f77bb34446201.png

Edited by archelium
added more details, again.
Link to comment
On 9/12/2021 at 3:26 PM, itsmevictor said:

@biati @Pearcen@fddc I think that I have found a solution to have the workflow running on MacOS Monterey. As @Pearcensuggested, the problem seems to lie with MacOS Monterey not including PHP, thus preventing the workflow from running. I've downloaded PHP for MacOS Monterey using this Homebrew tap and the workflow is now running. 

 

EDIT: Actually, it seems to only be partially running. I'll look into it in greater depth later.

 

I can confirm that it is partially working, but need to be running PHP 7.4 or below. PHP 8.0 does not seem to work for me. I am however getting a number of errors in the debug menu when typing anything on alfred. This is what it spits out when I type "123" on alfred:

 

[16:05:24.842] Calculate Anything[Script Filter] Queuing argument ''
[16:05:24.909] Calculate Anything[Script Filter] Script with argv '(null)' finished
[16:05:24.909] ERROR: Calculate Anything[Script Filter] Code 127: /bin/bash: php: command not found
[16:05:27.034] Calculate Anything[Script Filter] Queuing argument '2'
[16:05:27.039] Calculate Anything[Script Filter] Script with argv '(null)' finished
[16:05:27.042] ERROR: Calculate Anything[Script Filter] Code 127: /bin/bash: php: command not found
[16:05:27.273] Calculate Anything[Script Filter] Queuing argument '23'
[16:05:27.340] Calculate Anything[Script Filter] Script with argv '(null)' finished
[16:05:27.340] ERROR: Calculate Anything[Script Filter] Code 127: /bin/bash: php: command not found

 

Link to comment

@archelium Could you please provide as much information as possible? E.g. workflow debugger logs, any console logs that might be relevant? Saying "It doesn't work" and providing shut-down answers make it difficult to help.

 

Our community is here to help, but no one can see what's happening on your Mac specifically or know what you do/don't have installed, so please be as comprehensive as possible in providing this information.

 

I have removed your most recent post, and would ask that all parties in this thread please take a moment to breathe before responding. This community is intended to be friendly and helpful, and posts that do not meet our Community Guidelines will be removed.

Link to comment

Okay, the problem is that the workflow also calls php directly from bash scripts, which Alfred can’t fix so easily.


Until we get an option to turn on Homebrew support, the only fix is to edit each of the Script Filters on the left-hand side from 0 down to time.

 

In each of those Script Filters, at the top of each Script whose Language = /bin/bash, insert the line export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH

 

That should fix the workflow. I can’t test the fix because the workflow isn’t broken on my machine.

Link to comment
1 hour ago, Vero said:

@archelium Could you please provide as much information as possible? E.g. workflow debugger logs, any console logs that might be relevant? Saying "It doesn't work" and providing shut-down answers make it difficult to help.

 

Our community is here to help, but no one can see what's happening on your Mac specifically or know what you do/don't have installed, so please be as comprehensive as possible in providing this information.

 

I have removed your most recent post, and would ask that all parties in this thread please take a moment to breathe before responding. This community is intended to be friendly and helpful, and posts that do not meet our Community Guidelines will be removed.

 

Yeah, got it, I apologize if I was out of line. Will try to provide as much detail as possible going forward.

 

1 hour ago, deanishe said:

Okay, the problem is that the workflow also calls php directly from bash scripts, which Alfred can’t fix so easily.


Until we get an option to turn on Homebrew support, the only fix is to edit each of the Script Filters on the left-hand side from 0 down to time.

 

In each of those Script Filters, at the top of each Script whose Language = /bin/bash, insert the line export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH

 

That should fix the workflow. I can’t test the fix because the workflow isn’t broken on my machine.

 

Thank you, that did fix the errors in the debug, though I have yet to test out all the different features. Will update here once I go through them all.

Link to comment

Thank you so much. With the amazing workflow you created, I can now do exchange currency, numerical calculations, and percentages at once. I just joined the forum to say thank you! I hope you work less and make a lot of money be a super super rich!!!!!!


If you guys have a problem with setting the base currency, just search for ca on alfred and enter your exchange rate!!


 

image.png

Link to comment

Still cannot make it work on Monterey Intel Mac. I brew installed php using. The workflow crashes the moment I type "ca".

Please assist. I cannot make sense of the code, maybe you could. Here is the log:

 

[16:48:39.960] Calculate Anything[Script Filter] Queuing argument ''

[16:48:40.032] Calculate Anything[Script Filter] Script with argv '' finished

[16:48:40.034] STDERR: Calculate Anything[Script Filter] PHP Deprecated:  Required parameter $keywordsArray follows optional parameter $word in /Users/MYNAME/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.940D56D2-1406-4D8B-AC77-F3635740EF99/workflow/calculateanything.php on line 678

[16:48:40.035] Calculate Anything[Script Filter] Deprecated: Required parameter $keywordsArray follows optional parameter $word in /Users/MYNAME/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.940D56D2-1406-4D8B-AC77-F3635740EF99/workflow/calculateanything.php on line 678

{"items":[{"title":"Calculate Anything","subtitle":"Calculate Anything...","valid":true,"uid":"ca","arg":"ca ","variables":{"fromkeyword":true,"action":"menu"}}]}

[16:48:40.036] ERROR: Calculate Anything[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:

Deprecated: Required parameter $keywordsArray follows optional parameter $word in /Users/MYNAME/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.940D56D2-1406-4D8B-AC77-F3635740EF99/workflow/calculateanything.php on line 678

{"items":[{"title":"Calculate Anything","subtitle":"Calculate Anything...","valid":true,"uid":"ca","arg":"ca ","variables":{"fromkeyword":true,"action":"menu"}}]}

Link to comment

managed to get it to work

I basically removed all php and reinstalled homebrew php and added "export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH" on every script filter.

there's still some issues that i am unable to get it to work such as currency converter, the results just doesnt show when i type "100 usd to sgd". Great workflow nevertheless

image.thumb.png.0ab4e879e256c27fcb4b1f455a76cd2b.png

Link to comment

@itsmevictor @archelium @ProRock @alfredpanda the latest version has been released, you can download it here https://github.com/biati-digital/alfred-calculate-anything/releases

 

The workflow now works correctly with Monterey.

 

For users that might have not read the discussion in the forum or Github, to summarize:

 

1.- You need to install PHP with Homebrew (explained in the ReadMe)

2.- You need the latest version of Alfred

3.- You need the latest version of Calculate Anything.

 

For users on Mac OS Big Sur or lower you do not need to do anything, Your OS already includes PHP, just install the workflow and it will work without problems.

 

Link to comment
  • 4 weeks later...

People are saying it's working perfectly now. I just installed this, and perhaps I missed a step?

 

I am on an M1 Mac, running Monterey. I ran the command to install Homebrew. I then installed php. I downloaded the most up to date version of CA and ran it. when I open Alfred and type ca, I was able to set a language and base currency. all those commands appear. but when I try to type something like "100 euros to usd" I get search google, search amazon and search wiki. what step did I miss?

Link to comment

Hi @dampearth, welcome to the forum.

 

3 hours ago, dampearth said:

I get search google, search amazon and search wiki.

 

Those are Alfred's fallback searches. They're shown if a workflow returns no results.

 

We can't possibly diagnose an issue without more information than that. If a workflow isn't working properly, check the debugger for error messages and always include them in your posts.

Edited by deanishe
Link to comment
14 hours ago, deanishe said:

Hi @dampearth, welcome to the forum.

 

 

Those are Alfred's fallback searches. They're shown if a workflow returns no results.

 

We can't possibly diagnose an issue without more information than that. If a workflow isn't working properly, check the debugger for error messages and always include them in your posts.

ok I'm having issues with the coinmarketcap api. I would type 1 bitcoin, and it told me I needed to get the api. I got the api and now it shows the fallback searches.

here's debugger

Quote

[10:18:29.525] Calculate Anything[Script Filter] Queuing argument ''

[10:18:29.598] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:29.600] Calculate Anything[Script Filter] {"items":[]}

[10:18:29.785] Calculate Anything[Script Filter] Queuing argument ' '

[10:18:29.843] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:29.846] Calculate Anything[Script Filter] {"items":[]}

[10:18:29.940] Calculate Anything[Script Filter] Queuing argument ' b'

[10:18:29.992] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:29.995] Calculate Anything[Script Filter] {"items":[]}

[10:18:30.052] Calculate Anything[Script Filter] Queuing argument ' bi'

[10:18:30.091] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:30.095] Calculate Anything[Script Filter] {"items":[]}

[10:18:30.145] Calculate Anything[Script Filter] Queuing argument ' bit'

[10:18:30.178] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:30.185] Calculate Anything[Script Filter] {"items":[]}

[10:18:30.316] Calculate Anything[Script Filter] Queuing argument ' bitc'

[10:18:30.367] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:30.373] Calculate Anything[Script Filter] {"items":[]}

[10:18:30.415] Calculate Anything[Script Filter] Queuing argument ' bitco'

[10:18:30.451] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:30.460] Calculate Anything[Script Filter] {"items":[]}

[10:18:30.498] Calculate Anything[Script Filter] Queuing argument ' bitcoi'

[10:18:30.529] Calculate Anything[Script Filter] Script with argv '(null)' finished

[10:18:30.535] Calculate Anything[Script Filter] {"items":[]}

[10:18:30.559] Calculate Anything[Script Filter] Queuing argument ' bitcoin'

 

 

Edited by dampearth
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...