Temporary Auto Mute while using web browser

Problem: I want to watch some video content on the web, but I don’t want to watch/listen to those stupid commercials they force on me - again & again & again. There is no after market application that truly solves the problem. Ad Blocker is the “best” I could find. It doesn’t work for video commercials. I think there is a simple solution using Apple Script, but I’m not tech proficient.

If you are anything like me you have several “mini- tasks” to complete at your computer at any give time. If I just push the mute button with the intention of coming back as soon as the 15 second commercial is over, I many times, miss the beginning content of what I wanted to hear/watch. Sometimes I miss the whole clip and have to start all over again. Instead of wasting my time auditorily paying attention to the commercial so that I don’t miss the beginning of my intended content I believe an AppleScript could temporarily mute the volume of the video and when the sound comes back on it will prompt me to bring my attention back when the content I want to view starts to play. Please, Please, Please I hope there is a tech brain out there that shares my irritation and can give the world a practical workable solution with a simple AppleScript!

Script I envision:
While in safari (or any web browser)

  • IF I push, command + m, THEN the volume is muted for 15 seconds and automatically un mutes after 15 seconds - UNLESS
  • Any time during that 15 seconds of mute IF for every additional time I push the “m” key, THEN an additional 5 seconds is added to the temporary mute period (ie - I push the “m” key 3 times then an additional 15 seconds is added for a total of 30 seconds of temporary mute).

PS - I am truly a neophyte at the technical side of macs

Model: MacBook Air
AppleScript: 2.4.3 (131.2)
Browser: Safari 536.29.13
Operating System: Mac OS X (10.7)

Hi mann,

Command + M is already used to minimize windows.

kel

I did know that, I was hoping a tec minded individual would add the script the code that first disabled minimize windows while in Safari. Lookin for help not for road blocks. :rolleyes::frowning:

Hi mann,

I was thinking that you might use a stay open app with a reopen handler to add 5 seconds. Something like this:


global output_vol, target_date
--
on run
	set output_vol to output volume of (get volume settings)
	set target_date to (current date) + 15
	set volume with output muted
end run
--
on reopen
	set target_date to target_date + 5
end reopen
--
on idle
	if (current date) > target_date then
		set volume output volume output_vol
		quit
	end if
	return 1
end idle

On initialization the unmute is set at 15 seconds. Whenever you relaunch the app, it adds 5 seconds. There are many ways I can think of to run the app. You can relaunch it in the dock, as long it’s there.

gl,

Model: MBP
AppleScript: 2.2.3
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)

I created an Automator service to launch the app. Then, in System Preferences, I assigned a keyboard shortcut, but I can’t get the shortcut to work. Wasn’t it Einstein who couldn’t change a light bulb? :slight_smile:

Unfortunately non of these will cut the mustard. Perhaps I don’t understand AppleScript. Think about it a bit. Say you are in Huffington Post and you want to watch a Daily Show clip. You click on the link and it comes up. You push play and you get the information that says, “your video will play in 15 seconds,” or “your video will play in 30 seconds.” or something like that. and then the commercial(s) start.

You want to watch the Daily Show clip but you don’t want to listen to the commercials for 15 to 30 seconds (or whatever the length they force on you). I can answer a couple of emails in that time. But if I have to listen to the commercials drone on in the background I can’t focus. I want silence, but I want to get prompted back to watch the Daily Show clip once the insidious commercials are over - I don’t need to know how freeking fast verizon is any more. However, if I get too focused on answering emails while the mute is on I’ll forget and miss the entire clip. So if the mute automatically releases the sound from the start of the Daily Show clip will prompt me back - Waalah!

Get it. When the clip starts to load I see how much time I can mute. By Starting at 15 seconds and being able to add increments of 5 with a single keystroke it will allow me to set my reminder to come back and watch the clip. I get to skip the commercials and finish one of my many mini tasks for the day!

I can’t believe the tec smarty pants haven’t worked this out already! I know AdBlocker is making millions and their app don’t do S%!T

I did! :smiley:

Create an Automator service that launches the app and give it a shortcut in the Keyboard preference pane. All you need to do is use the shortcut to continuously launch the STAY OPEN application.

BTW, you could also make the application background only so it doesn’t show in the dock and move your browser to the background.

gl,

Kel,

You did what? What is the solution - step by step for me please. I am a true neophyte. I just know it is possible and it will be useful for all of humanity. :smiley:

I did it, I did it! In Automator, make a service to launch application. Set the Services receives no input in any application. Now I’m saving it and trying to add a keyboard shortcut to the service.

Editted: Automator ‘launch application’ didn’t reopen the app. Back to the drawing board. :confused:

Kel 1 - I think I get the short hand. are you just telling me to be patient and I will see the step by step when you work out all the details?

Yes, or until somebody helps in how to rerun an app with a shortcut.

It seems that Automator’s 'Launch Application" doesn’t send a run command if it’s already open. So, had to use an AppleScript in Automator.

Open Automator
Click on the Service wheel
Select
Click on Utilities in the Library window
Double click on Run AppleScript
Your script should look like this


on run {input, parameters}
	
	tell application "IdleTest" -- change "IdleText" to whatever you named your STAY OPEN app
		run
	end tell
	
	return input
end run

At the top of the window, where it says ‘Service receives selected text’, change ‘text’ to ‘no input’ in the popup menu. Then, save the service with a name. The name you give it will turn up in the System Preferences > Keyboard pane. Note: the saved file will be located in your home Library in the Services folder.

Now go to System Preferences > Keyboard > Services > General. To give it a shortcut double click on the right side where the shortcuts are and enter on the keyboard your short cut. I used Command + F10. You might need to also hold the fn key if you use a function key. You’re done.

It’s not very accurate, but works ok.

Editted: there might be a way to make the app faster. Maybe, work with the seconds in the reopen handler instead of the date. Then, it won’t miss some keystrokes. Keep in touch. I gotta do some stuff right now.

gl,

Hi mann,

It doesn’t work very well when connecting keystrokes to running the app, but it works very well with clicking the app in the dock. Maybe I’ll come up with something later with the keyboard shortcut.

gl,

Do you have a keyboard with the volume keys on it? Use the mute button, then unmute when you are ready.

Kel 1 - you are stellar for taking a go at it -thank you for your efforts.

SuperMacGuy - clearly you did not read the thread and my narrative. Put on your SuperMacGuy hat and give us neophytes something to feel “wowed” about.