Fluent-Search-Tasks icon indicating copy to clipboard operation
Fluent-Search-Tasks copied to clipboard

Pass searchText to Python script via PS Script

Open rangulvers opened this issue 2 years ago • 1 comments

Hi, I want to run a python script from fluent search. As a workaround I used the Tasks option with the PS Script option to run "python myscript.py"

Not very clean but it works (direct option to run a python script would be great)

But how do I pass a parameter to the python script via the PS Script option? I want to pass the searchText and tried

python myscript.py {searchText} python myscript.py "{searchText}" python myscript.py searchText

Here is how the flow looks

image

Any hints?

Love you work

rangulvers avatar Aug 30 '23 12:08 rangulvers

Hey I guess I answered you in Discord, but writing here as well for the sake of documentation. To access variables in PowerShell script you need to use this syntax - $myVariable, this is as Fluent Search assigns the value in an actual PowerShell variable (and not simply replace strings), I am also considering adding built in support for Python in 1.0.0, will update on that.

adirh3 avatar Aug 30 '23 20:08 adirh3