Jump to content
dfay

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?

Share this post


Link to post

That's a good point -- I can envision a lot of scenarios where a toggle would make sense if you have a screen in front of you, but where separate buttons are preferable where the state might be unknown.

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...