vitor Posted December 4, 2021 Share Posted December 4, 2021 Setup Turn on Allow JavaScript from Apple Events in the browsers you want to control. Use the Help search in the menubar to find it. Usage Pause audio and video in tabs of all open web browsers via the pause all keyword. pause others does the same except for the current tab. ⌘↩ makes it only pause tabs from the current browser. ⤓ Install on the Alfred Gallery | Source paulw and JJJJ 2 Link to comment
vitor Posted December 4, 2021 Author Share Posted December 4, 2021 When reporting issues, please include your exact installed versions of:The Workflow.Alfred.macOS.In addition to:The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better. Link to comment
sosaveme Posted December 24, 2021 Share Posted December 24, 2021 Hello! "Allow JavaScript from Apple Events" Is it potentially dangerous? Link to comment
vitor Posted December 24, 2021 Author Share Posted December 24, 2021 Apple certainly means to scare you when you enable the option: Which is true. And it’s why I don’t provide warnings in the Workflow, since the browsers do it themselves. Activating the option means your browser can be controlled programatically, which is the only way this Workflow can work but it also means it opens the gates to other tools. I never heard of malware which did anything via this route, which isn’t to say it couldn’t be built. Standard care about which tools you tend to run apply. Link to comment
sosaveme Posted December 25, 2021 Share Posted December 25, 2021 Nah, I think I'm fine without this workflow. But still thanks. The idea is great! Link to comment
vitor Posted December 26, 2021 Author Share Posted December 26, 2021 Update. It now also works on embedded YouTube players. Download the latest version. Link to comment
Kelson01 Posted December 28, 2021 Share Posted December 28, 2021 On 12/25/2021 at 7:57 PM, vitor said: Update. It now also works on embedded YouTube players. Download the latest version. Ayy! This workflow finally got made! I'm downloading it right now and we'll see if it works with all of my browser tabs!* - To anyone reading this: for context it was my hundreds of youtube tabs that autoplayed that led to vitor creating this workflow...I eventually gave up and disabled autoplaying on YouTube, though I didn't want to. Vitor, perhaps it's a limitation of Brave Browser, but the script appears to be timing out. I only had one video playing when I tried this each time but I still have all of my tabs. I tried every variation of triggering this workflow with the keywords and it all ended up in the same result. It didn't work for me. Am I doing something wrong? but Link to comment
vitor Posted December 28, 2021 Author Share Posted December 28, 2021 14 minutes ago, Undertaker01 said: perhaps it's a limitation of Brave Browser Unlikely. I also used it to test and all Chromium browsers have similar AppleScript. I wonder what different about your setup; you seem to still be the only one to experience that and this has more users now. Link to comment
Kelson01 Posted December 28, 2021 Share Posted December 28, 2021 25 minutes ago, vitor said: Unlikely. I also used it to test and all Chromium browsers have similar AppleScript. I wonder what different about your setup; you seem to still be the only one to experience that and this has more users now. I do have 400 or so tabs open... lol. If you want I can troubleshoot with you. I'm pretty sure that I'm doing everything right. Should I have you friend me on discord? Link to comment
vitor Posted December 29, 2021 Author Share Posted December 29, 2021 I don’t use Discord and it wouldn’t be a good use of our time to diagnose four hundred individual pages when you can do the way simpler and faster solution of trying it with fewer tabs. Timeouts should happen per event, which would mean one or more of the pages could be the problem as they are not letting the necessary JavaScript run or it’s taking too long to finish for another reason. Try this version, which will output to the debugger the URL it’s trying to pause before it does it. It might give a clue. Link to comment
Kelson01 Posted December 29, 2021 Share Posted December 29, 2021 16 minutes ago, vitor said: Try this version, which will output to the debugger the URL it’s trying to pause before it does it. It might give a clue. Okay! I'll save this and let you know what it does in a bit. 17 minutes ago, vitor said: trying it with fewer tabs Funnily enough I open about 50 new tabs daily and close about 50 old tabs. I consume a lot of content in order to learn as much as possible in a given amount of time. I've been trying my best, installing reading list extensions, adding bookmarks and watching videos at double speed... I've been working at making Alfred workflows to open groups of URLS and it's on my list to organize my bookmarks so I can put them in folders. Maybe there's an Alfred workflow to help manage this? Having a workflow that connects with a reading list chromium extension would be nice. Or a simpler workflow that allows you to add/remove links from it to act as a reading list within Alfred itself. OR both - I might need more than 1 workflow to have multiple reading lists! Link to comment
vitor Posted January 2, 2022 Author Share Posted January 2, 2022 On 12/29/2021 at 5:41 PM, Undertaker01 said: Maybe there's an Alfred workflow to help manage this? Having a workflow that connects with a reading list chromium extension would be nice. If you use Pinboard (it has a toread list), PinPlus can both add and act on the reading list items. There are a couple Safari Reading List Workflows you can search for as well. I won’t link to them because I don’t know which (still) work. Adding and removing items is easy with those, but removing needs to be done via GUI Safari. Finally, there are Workflows for Pocket and Instapaper. Link to comment
Kelson01 Posted January 2, 2022 Share Posted January 2, 2022 Thanks so much for the suggestions! Going through and debugging this workflow is still on my to do list if you still need it! Link to comment
vitor Posted July 13, 2022 Author Share Posted July 13, 2022 (edited) Updated to 2022.2. Use Alfred 5 Automation Task to get Frontmost App. Edited July 13, 2022 by vitor Link to comment
vitor Posted October 8, 2022 Author Share Posted October 8, 2022 Updated to 2022.3. Add configurable keyword. Link to comment
andy4222 Posted October 30, 2022 Share Posted October 30, 2022 Tried this workflow with Chrome but it doesn't pause the video/audio. A min or so later it shows time out error in the logs [11:58:31.145] Pause Tabs[Keyword] Processing complete [11:58:31.150] Pause Tabs[Keyword] Passing output '' to Arg and Vars [11:58:31.152] Pause Tabs[Arg and Vars] Processing complete [11:58:31.153] Pause Tabs[Arg and Vars] Passing output '' to Automation Task [11:58:31.154] Pause Tabs[Automation Task] Running task 'Identify Frontmost App' with no arguments [11:58:31.457] Pause Tabs[Automation Task] Processing complete [11:58:31.458] Pause Tabs[Automation Task] Passing output 'Alfred Preferences' to Arg and Vars [11:58:31.464] Pause Tabs[Arg and Vars] Processing complete [11:58:31.465] Pause Tabs[Arg and Vars] Passing output '' to Run Script [11:58:31.946] Pause Tabs[Run Script] Processing complete [11:58:31.947] Pause Tabs[Run Script] Passing output 'Brave Browser,Google Chrome ' to Transform [11:58:31.953] Pause Tabs[Transform] Processing complete [11:58:31.954] Pause Tabs[Transform] Passing output 'Brave Browser,Google Chrome' to Arg and Vars [11:58:31.955] Pause Tabs[Arg and Vars] Processing complete [11:58:31.956] Pause Tabs[Arg and Vars] Passing output '' to Run Script [11:59:33.076] ERROR: Pause Tabs[Run Script] /Users/<USER>/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D19A3B28-F1D3-47B1-8DFA-D932051BA08A: execution error: Error: Error: AppleEvent timed out. (-1712) [11:59:33.077] Pause Tabs[Run Script] Processing complete [11:59:33.084] Pause Tabs[Run Script] Passing output '' to Run Script [12:01:33.391] ERROR: Pause Tabs[Run Script] /Users/<USER>/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D19A3B28-F1D3-47B1-8DFA-D932051BA08A: execution error: Error: Error: AppleEvent timed out. (-1712) [12:01:33.393] Pause Tabs[Run Script] Processing complete [12:01:33.399] Pause Tabs[Run Script] Passing output '' to Run Script Link to comment
vitor Posted October 31, 2022 Author Share Posted October 31, 2022 Make sure you have Allow JavaScript from Apple Events is turned on in Chrome and Brave. Link to comment
andy4222 Posted October 31, 2022 Share Posted October 31, 2022 It's enabled. Triple checked, and also restarted macOS Link to comment
vitor Posted October 31, 2022 Author Share Posted October 31, 2022 Which links in specific aren’t being paused? Link to comment
andy4222 Posted October 31, 2022 Share Posted October 31, 2022 YouTube, both on Brave and Chrome Link to comment
vitor Posted October 31, 2022 Author Share Posted October 31, 2022 I need specific links to test. YouTube is paused just fine for me. Also, how many windows and tabs do you have open on each browser? Link to comment
andy4222 Posted November 1, 2022 Share Posted November 1, 2022 19 hours ago, vitor said: I need specific links to test. YouTube is paused just fine for me. https://www.youtube.com/watch?v=Uj0EVT-Ekog Logs: [23:25:39.134] Pause Tabs[Keyword] Processing complete [23:25:39.140] Pause Tabs[Keyword] Passing output '' to Arg and Vars [23:25:39.142] Pause Tabs[Arg and Vars] Processing complete [23:25:39.143] Pause Tabs[Arg and Vars] Passing output '' to Automation Task [23:25:39.144] Pause Tabs[Automation Task] Running task 'Identify Frontmost App' with no arguments [23:25:39.455] Pause Tabs[Automation Task] Processing complete [23:25:39.456] Pause Tabs[Automation Task] Passing output 'Alfred Preferences' to Arg and Vars [23:25:39.462] Pause Tabs[Arg and Vars] Processing complete [23:25:39.463] Pause Tabs[Arg and Vars] Passing output '' to Run Script [23:25:40.008] Pause Tabs[Run Script] Processing complete [23:25:40.009] Pause Tabs[Run Script] Passing output 'Google Chrome,Brave Browser ' to Transform [23:25:40.015] Pause Tabs[Transform] Processing complete [23:25:40.017] Pause Tabs[Transform] Passing output 'Google Chrome,Brave Browser' to Arg and Vars [23:25:40.018] Pause Tabs[Arg and Vars] Processing complete [23:25:40.019] Pause Tabs[Arg and Vars] Passing output '' to Run Script Link to comment
vitor Posted November 1, 2022 Author Share Posted November 1, 2022 (edited) You haven’t answered the other question: 23 hours ago, vitor said: Also, how many windows and tabs do you have open on each browser? Two more: which keyword are you using, and which browser extensions to you have active? And that’s for all browsers, since you’re always running it with both Chrome and Brave open. Edited November 1, 2022 by vitor Link to comment
andy4222 Posted November 1, 2022 Share Posted November 1, 2022 Keyword: pauseall (tried “pause” and other custom keywords as well) ublockorigin, pocket, evernote. Tried on single/multiple windows with/without focus Link to comment
vitor Posted November 1, 2022 Author Share Posted November 1, 2022 Could you try it with all extensions disabled? So I can start ruling out stuff. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now