Jump to content

Sending Keyboard Modifiers (Ctrl etc.)


Recommended Posts

Great! If you like, you could change the code for the mute button with:

if output muted of (get volume settings) is true then
set volume without output muted
else
set volume with output muted
end if

Then you don't need two buttons for Mute/Unmute. You can tap the same button for both functions. Also you can change the background color in the same green tone.

I thought about having a toggle, and came to a conclusion that it's going to be weird.

 

I'l explain. I really wanted alfred remote, for the situations where I'm in my bed already, and then I hear notifications from the mac, and I don't want to get up and mute it.

So I mad this workflow. The problem with having a mute toggle, is that you don't have feedback, and I don't think it's possible to change the icon based on if you're currently muted or not.

So potentially, if you mute and unmute, you can get lost and don't know if you are muted currently or not, which you will find out only if another sound comes from the mac.

 

So unless I can somehow change the icons based on the response, I think having two separate buttons for mute/unmute is better(atleast for my case)

 

What do you think?

Link to comment

Here's my Applescript for volume up:

 

on alfred_script()
do shell script "afplay /System/Library/Sounds/Pop.aiff"
 set vol to output volume of (get volume settings)
if vol > 90 then # 100 max
    set volume output volume 100
else
    set volume output volume (vol + 10)
end if
end alfred_script

and for volume down:

 

on alfred_script()
do shell script "afplay /System/Library/Sounds/Pop.aiff"
  set vol to output volume of (get volume settings)
if vol < 10 then # 0 is min
    set volume output volume 0
else
    set volume output volume (vol - 10)
end if


end alfred_script

Borrowed the clip sound from a thread somewhere on the web (that I can't find just now) to get some sort of feedback that things have happened. 

 

Edited by stephenmcleod
Link to comment
  • 3 weeks later...

on alfred_script()
	set step_size_ to 7
  	set volume_ to output volume of (get volume settings)

	if volume_ > (100 - step_size_) then
		set volume output volume 100
	else
		set volume output volume (volume_ + step_size_)
	end if
	if output muted of (get volume settings) is true then
		set volume without output muted
	end if
end alfred_script

(And adjust the step size to whatever you want).

 

Do the same thing for Decrease Volume, etc...

 

Thank you! This showed me (newbie as of today with Alfred Remote) exactly what I needed to see to start working with AppleScripts in Alfred Remote.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...