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

the costum setting don't work #2

Open
lemoxiao opened this issue Jul 22, 2019 · 1 comment
Open

the costum setting don't work #2

lemoxiao opened this issue Jul 22, 2019 · 1 comment

Comments

@lemoxiao
Copy link

I find code can work in Alfred to open hyper from alfredforum:

on alfred_script(q)
	if (text 1 thru 2 of q) is equal to "cd" then
		do shell script "open -a Hyper " & text 4 thru -1 of q
	else
		do shell script "open -a Hyper ~"
		set appOpen to false
		set nbrOfTry to 0
		delay 0.5
		repeat
			try
				tell application "System Events"
					if exists (window 1 of process "Hyper") then
						set appOpen to true
						exit repeat
					end if
				end tell
			end try
			set nbrOfTry to nbrOfTry + 1
			if nbrOfTry = 20 then exit repeat
			delay 0.5
		end repeat
		if appOpen then tell application "System Events" to keystroke q & return
	end if
end alfred_script
@urre
Copy link

urre commented Oct 16, 2020

can confirm that @lemoxiao solution works good for me also. Using the recommended script in the readme makes hyper type an alfred terminal command (in a workflow) multiple times.

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

2 participants