raguay / MyAlfred

This is where I am keeping my Alfred 2, Alfred 3, and Alfred 4 workflows.
441 stars 47 forks source link

ScratchPad workflow #16

Open cands opened 10 months ago

cands commented 10 months ago

Thanks for all the great Alfred workflows you've created, they have been very helpful and stable over several years. I think the ScratchPad workflow is a gem. Unfortunately it does not work anymore on Alfred 5.1.4 [2195] and macOS 13.5. I get the following error message in Alfred debugger:

[18:09:39.749] ScratchPad[Script Filter] Queuing argument '' [18:09:39.903] ScratchPad[Script Filter] Script with argv '(null)' finished [18:09:39.907] STDERR: ScratchPad[Script Filter] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 [18:09:39.908] ScratchPad[Script Filter] Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 <?xml version="1.0"?>

Get Clipboardicon.png

[18:09:39.909] ERROR: ScratchPad[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: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 <?xml version="1.0"?>

Get Clipboardicon.png
raguay commented 10 months ago

Hi,

I'm glad you like it. I've updated it for the latest version of Alfred and PHP. It is working on my system with PHP 8.1 installed. I'm assuming you have the latest PHP installed as well. If not, let me know and I will translate the script for a more standard configuration. But, since your error output is saying that the PHP usage is deprecated, you must be using the newer version already. You can get the updated workflow here: https://github.com/raguay/MyAlfred/blob/master/Alfred%205/ScratchPad.alfredworkflow

Richard

On Fri, Nov 10, 2023 at 12:16 AM cands @.***> wrote:

Thanks for all the great Alfred workflows you've created, they have been very helpful and stable over several years. I think the ScratchPad workflow is a gem. Unfortunately it does not work anymore on Alfred 5.1.4 [2195] and macOS 13.5. I get the following error message in Alfred debugger:

[18:09:39.749] ScratchPad[Script Filter] Queuing argument '' [18:09:39.903] ScratchPad[Script Filter] Script with argv '(null)' finished [18:09:39.907] STDERR: ScratchPad[Script Filter] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 [18:09:39.908] ScratchPad[Script Filter] Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23

Get Clipboardicon.png [18:09:39.909] ERROR: ScratchPad[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: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in Command line code on line 23 Get Clipboardicon.png — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
cands commented 10 months ago

Thank you very much, I confirm that it is working now!

Just another question regarding this workflow, the handling of umlaut characters does not seem ideal, this is a minor thing but if it would be easy for you to fix it would make the workflow even more convenient. For example, for the Swedish word "hallå" (hello) the umlaut character should be (as copied from Vim character info) "<å> 229, \345, U+00E5 LATIN SMALL LETTER A WITH RING ABOVE" but when using the ScratchPad workflow instead becomes "\<a> 97, \141, U+0061 LATIN SMALL LETTER A <°> 778, U+030A COMBINING RING ABOVE".

raguay commented 10 months ago

Just updated the routine to check for proper UFT8 encoding and convert if not. It seems to work for me, but I don't use your language. It's great with Thai.

Please give it a try.

Richard

On Mon, Nov 13, 2023 at 7:26 PM cands @.***> wrote:

Thank you very much, I confirm that it is working now!

Just another question regarding this workflow, the handling of umlaut characters does not seem ideal, this is a minor thing but if it would be easy for you to fix it would make the workflow even more convenient. For example, for the Swedish word "hallå" (hello) the umlaut character should be (as copied from Vim character info) "<å> 229, \345, U+00E5 LATIN SMALL LETTER A WITH RING ABOVE" but when using the ScratchPad workflow instead becomes " 97, \141, U+0061 LATIN SMALL LETTER A <°> 778, U+030A COMBINING RING ABOVE".

— Reply to this email directly, view it on GitHub https://github.com/raguay/MyAlfred/issues/16#issuecomment-1808070997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS7JR56J475LOHS3A6KTO3YEIGVZAVCNFSM6AAAAAA7E5FTISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGA3TAOJZG4 . You are receiving this because you commented.Message ID: @.***>

cands commented 9 months ago

Thanks a lot for looking into it. Unfortunately, is still does not work for Swedish characters (which it should with proper UTF-8 encoding, however the behavior is the same as before). Nevertheless, it is still a very useful workflow (I also write a lot in English), thanks again for creating it and keeping it updated.