Skip to content

Commit

Permalink
Add Oh New Window & Oh New Search Workflows;
Browse files Browse the repository at this point in the history
  • Loading branch information
lroolle committed May 11, 2020
1 parent 8955336 commit a7ff8ca
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 2 deletions.
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

Alfred awesome workflows.

主子您值得拥有
你值得拥有

---

# 下载

> [Workflow Releases](https://github.com/lroolle/ohmyalfred/releases)

---

# 欧路快查
Expand Down Expand Up @@ -76,7 +77,7 @@ macOS Alfred 4 网易云全局快捷控制!

### 具体如下:

| | | |
| 命令 | 含义 | 说明 |
| -------- | -------------- | -------------- |
| **`p`** | `P`lay/`P`ause | 播放/暂停 |
| **`n`** | `N`ext | 下一曲 |
Expand All @@ -91,3 +92,49 @@ macOS Alfred 4 网易云全局快捷控制!
| **`v-`** | `V`olume+ | 降低音量 |
| **`h`** | `H`ide | 隐藏窗口 |
| **`q`** | `Q`uit | 退出网易云音乐 |


---

# Oh New Window 新建窗口

> Alfred 快速新建窗口
- 1). 输入 `o` + `应用名` + `回车`: 在当前 Workspace 打开新窗口;

![](./screenshots/ohnewwindow_new_chrome.gif)

- 2). 输入 `o` + `应用名` + `⌥Option` + `回车`: 在当前 Workspace 打开新隐身窗口;

![](./screenshots/ohnewwindow_new_chrome_incognito.gif)


### 当前支持应用

* Finder
* Chrome(隐身窗口支持)
* Safari(隐身窗口支持)
* Firefox(隐身窗口支持)
* iTerm2
* Alacritty(Only if "SpawnNewInstance" enabled and set keybindding CMD+N)


---

# Oh New Search 选中快速搜索


> 选中文本(任意程序),敲击快捷键(`⇧Shift` + `⌘Command` + `S`)快速打开浏览器搜索





---

# Changelog


* 20200511: Add Oh New Window & Oh New Search Workflows;

Binary file added screenshots/ohnewwindow_new_chrome.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/ohnewwindow_new_chrome_incognito.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions scripts/new_window.scpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-- Open new application window within current workspace
-- Script Version 0.0.1
-- Alfred Version 4.0.9

-- Applications current support:
-- * Finder
-- * Chrome
-- * Safari
-- * Firefox
-- * iTerm2
-- * Alacritty(Only if "SpawnNewInstance" enabled and set keybindding CMD+N)


on alfred_script(q)

set q to name of (info for q)

if q is equal to "Finder.app"
tell application "Finder" to make new Finder window
else if q is equal to "Google Chrome.app"
tell application q to make new window
else if q is equal to "Safari.app"
tell application "Safari" to make new document
else if q is equal to "Firefox.app"
tell application "System Events"
tell process "Firefox"
click menu item "New Window" of menu "File" of menu bar 1
end tell
end tell
else if q is equal to "Alacritty.app"
tell application "System Events" to keystroke "n" using command down
else if q is equal to "iTerm.app"
run script "
on run {q}
tell application \"iTerm\"
create window with default profile
end tell
end run
" with parameters {q}
else
tell application q
reopen
end tell
end if


tell application q to activate

end alfred_script
Binary file added workflows/oh-new-search.alfredworkflow
Binary file not shown.
Binary file added workflows/oh-new-window.alfredworkflow
Binary file not shown.

0 comments on commit a7ff8ca

Please sign in to comment.