Jump to content

PHP Workflow running, but not printing its results


Recommended Posts

Hello!

 

Alfred newbie here and trying to get an oldish workflow, Datespan, working in Alfred 5 on Monterey.

 

I'm aware part of the trouble is that PHP is no longer packaged with macOS, and I went out and got it through Homebrew.

 

Now the script is doing its calculations, I can tell because when i look at debug mode (output below), I can see the calculations i am looking for, but they don't show up visibly in Alfred.

 

The problem seems to be some sort of depecated XML, but I'm out of my depth here.

 

It's tantalizing because the I know the calculation is working, I just cannot for the life of me figure out how to get Alfred to print it for me.

1674039152_ScreenShot2022-07-16at8_10_11AM.thumb.png.29e3f2dc945e27b3c6a52c9551f43111.png

 

[08:03:53.511] Date Span[Script Filter] Queuing argument ' 2/14'
[08:03:53.616] Date Span[Script Filter] Script with argv '(null)' finished
[08:03:53.620] STDERR: Date Span[Script Filter] mkdir: /Users/eric/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data: No such file or directory
mkdir: /Users/eric/Library/Application Support/Alfred 2/Workflow Data: No such file or directory
PHP Deprecated:  SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
PHP Deprecated:  SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
PHP Deprecated:  SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
PHP Deprecated:  SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
PHP Deprecated:  SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
PHP Deprecated:  SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
[08:03:53.623] Date Span[Script Filter] Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
<?xml version="1.0"?>
<items><item uid="complete" arg="5 months, 3 days, 8 hours and 3 minutes ago" valid="yes" autocomplete=""><title>5 months, 3 days, 8 hours and 3 minutes ago</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="business weeks" arg="30 business weeks" valid="yes" autocomplete=""><title>30 business weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="weeks" arg="21 weeks" valid="yes" autocomplete=""><title>21 weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="days" arg="152 days" valid="yes" autocomplete=""><title>152 days</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="hours" arg="3,648 hours" valid="yes" autocomplete=""><title>3,648 hours</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="minutes" arg="218,880 minutes" valid="yes" autocomplete=""><title>218,880 minutes</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item></items>
[08:03:53.625] ERROR: Date Span[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: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198

Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198
<?xml version="1.0"?>
<items><item uid="complete" arg="5 months, 3 days, 8 hours and 3 minutes ago" valid="yes" autocomplete=""><title>5 months, 3 days, 8 hours and 3 minutes ago</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="business weeks" arg="30 business weeks" valid="yes" autocomplete=""><title>30 business weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="weeks" arg="21 weeks" valid="yes" autocomplete=""><title>21 weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="days" arg="152 days" valid="yes" autocomplete=""><title>152 days</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="hours" arg="3,648 hours" valid="yes" autocomplete=""><title>3,648 hours</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="minutes" arg="218,880 minutes" valid="yes" autocomplete=""><title>218,880 minutes</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item></items>

 

Edited by ericlimer
adding image
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...