adirh3 / Fluent-Search-Tasks

Shared Fluent Search Task Projects to boost your productivity
30 stars 4 forks source link

Pass searchText to Python script via PS Script #3

Open rangulvers opened 1 year ago

rangulvers commented 1 year ago

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

adirh3 commented 1 year ago

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.