Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status menu: Menu argument not being passed #260

Open
dannythunder opened this issue Oct 11, 2023 · 0 comments
Open

Status menu: Menu argument not being passed #260

dannythunder opened this issue Oct 11, 2023 · 0 comments

Comments

@dannythunder
Copy link

dannythunder commented Oct 11, 2023

I'm doing a status menu item that I'm going to use to open Rider with env. vars loaded (Rider has a problem with loading env. vars when starting it normal).

It should be simple, but I must be missing some obvious here.

This is my assumption after reading the docs:

  • Scripts are read and executed as is (just like a normal script)
  • To create a menu with clickable menu options you create a if/else where you echo your menu in if (depending on the if-statement)
  • When clicking a menu option the script "re-runs" but with an argument set that corresponds to the output of the menu option.
  • You then "catch" this argument and do whatever you want.

But the argument seem to be empty for me. I tried a bunch of stuff (just one example posted here)

My simple menu:

CleanShot 2023-10-11 at 14 28 48@2x

Platypus app

CleanShot 2023-10-11 at 14 44 22@2x

Platypus version

CleanShot 2023-10-11 at 14 44 41@2x

Found this issue, but it didn't help me much:

Status Menu variable not being sent to bash script #226

The script:

#!/bin/zsh

openRider="Öppna Rider"
quit="Avsluta"

if [ $# -eq 0 ]
then

	echo $openRider
	echo $quit

else # else for now when testing

	#Open Finder if it works, just for testing
	open -R .

	# TODO Load external env vars.

        #open ~/Library/Application\ Support/JetBrains/Toolbox/apps/Rider/ch-0/232.9921.83/Rider.app
fi

Bonus question

How do a get an alert? echo alert from documentation is not working for me (becomes a menu option with the "error text" if there is something wrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant