Helper scripts playing with browser tabs, and more... Require OS X Yosemite+
Actions: baction ; [option : value]; [notes|extras...]
Settings: bset action ; set_flag: flag set_value: value
-
action - keyword to trigger action, e.g.
switch
,unstash
-
flags - on/off value, e.g.
clone
- You can prepend prefix to flags to override default settings
@
- force flag being on state!
- force flag being off state- priority:
@
>!
> no prefix
- You can prepend prefix to flags to override default settings
-
option: value - key-value pairs of options, e.g.
from: Google Chrome
-
notes | extras - additional text data, e.g.
Stash Group Name on Feb 29
Action: bswitch [clone|dedupe|reverse]; [from:|to:|index:]
Set Default Flags: bset switch
- clone - Keep original tab(s) after switching
- dedupe - Deduplicate URL in target browser before opening a new tab
- reverse - Reverse lookups of source and target browsers
- from - Source browser to switch tab(s) from, full application name or browser types
- to - Target browser to switch tabs(s) to, full application name or browser types
- index - Tab index number in the browser window to execute the workflow
- Set index to
all
to switch all tabs, or use action modifieralt
- Set index to
Action: bcopy [url|title|selection|markdown|tabs] ; [from:|index:|format:]
Set Default Flags: bset copy
- url - Copy URL of target window/tab if available
- title - Copy browser tab title or application window name
- selection - Copy selected text in window/tab if available
- markdown - Copy URL and title as a link in markdown syntax
- tabs - Copy information of tabs in JSON string format
- from - Source browser to switch tab(s) from, full application name or browser types
- index - Tab index number in the browser window to execute the workflow
- Set index to
all
to copy data from all tabs, or use action modifieralt
- Set index to
- format - text formatting preset name used to generate copied text content, see User Files section below to see more details of the presets file.
Action: bopen [dedupe] ; [in:]
Set Default Flags: bset open
- dedupe - Deduplicate URL in target browser before opening a new tab
- Use action modifier
alt
can open all extracted URLs
- Use action modifier
- search - Fallback to search when no URL was detected.
- in - Target browser to open URL(s)
Action: bstash [clone] ; [from:]; <stash group name>
Set Default Flags: bset stash
- clone - Do not close tabs after stashed them to group
- from - Source browser to get the list of tabs to stash
- stash group name - Group name saved in the stash file
Action: bunstash [clone] ; [to:]; <search>
Set Default Flags: bset unstash
- clone - Do not remove stash record after unstashed tabs
- to - Target browser to restore tabs to
- search - Search string to filter list of stashed groups
-
stash list -
$USER_HOME/.config/bs-alfredworkflow/stash.json
Auto-generated by workflow when necessary. -
user config -
$USER_HOME/.config/bs-alfredworkflow/config.json
Auto-generated by workflow when necessary.-
Can define lists of user browsers, and the first one of each group is considered as default, e.g.
{ "browsers": { "safari": ["Safari Technology Preview", "Safari"], "chrome": ["Google Chrome", "Google Chrome Canary", "Chromium"] } ... }
-
-
text formatting presets -
$USER_HOME/.config/bs-alfredworkflow/formats.json
Manually create if you want to utilize this feature.-
basic scheme: { "preset_name": "format_string"}
-
wrapping flag with
##
to represent the content in format string -
flags not enabled in
copy
command but appearing in format_string will be skipped -
example:
{ "markdown": "[##title##](##url##)", "custom1" : "##title## ##url##", "custom2" : "##title##\n##url##", "custom3" : "(##url## \"##title##\")" }
-
./<action>.js <preview|run|defaults|set> [flags] ; [options] ; [notes|extras] ; [overrides]
- preview - Returns XML content of the query previews in Alfred
- run - Execute the query of action
- defaults - Returns XML content of the settings previews in Alfred
- set - Set default on/off states of flags per action
- Create new action from Actions - Run Script, choose language /bin/bash
- Write your own command with the call type of run, e.g.
./copy.js run "selection markdown; from: Safari"
- Assign a preferred trigger like a Hot Key, drag and connect trigger and action and output
- For the result items of browser tabs shown in Alfred, press
⌘C
to copy URL and title in markdown link format ⌘L
to see parsed query string, or error message, for debug use- ...
stash
action to save/open multiple tabs at one timeAllow to specify source and target browserAdd delay and result validation between actions in command flow(Removed the feature of actions flow)- Firefox support
- Configurations of default options/
flags - Configurable notifications
MIT
Icons from iconfinder.com