-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Address issue #47 - Add Microsoft Edge support - Don't use 'sed' hack to set user name
- Loading branch information
Showing
8 changed files
with
306 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "alfred-pinboard-rs" | ||
version = "0.15.9" | ||
version = "0.15.10" | ||
authors = [ "Hamid Ghadyani <[email protected]>",] | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
on appIsRunning(appName) | ||
tell application "System Events" to (name of processes) contains appName | ||
end appIsRunning | ||
|
||
|
||
on run | ||
set theApplication to (name of (info for (path to frontmost application))) | ||
set theText to "" | ||
set theURL to "" | ||
|
||
if theApplication is "Google Chrome.app" and appIsRunning("Google Chrome") then | ||
set theResult to run script "tell application id \"com.google.chrome\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Opera.app" and appIsRunning("Opera") then | ||
set theResult to run script "tell application id \"com.operasoftware.Opera\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Opera Developer.app" and appIsRunning("Opera") then | ||
set theResult to run script "tell application id \"com.operasoftware.OperaDeveloper\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Opera Beta.pp" and appIsRunning("Opera") then | ||
set theResult to run script "tell application id \"com.operasoftware.OperaNext\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Vivaldi.app" and appIsRunning("Vivaldi") then | ||
set theResult to run script "tell application id \"com.vivaldi.Vivaldi\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Brave Browser.app" and appIsRunning("Brave Browser") then | ||
set theResult to run script "tell application id \"com.brave.Browser\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Brave Browser Beta.app" and appIsRunning("Brave Browser Beta") then | ||
set theResult to run script "tell application id \"com.brave.Browser.beta\" | ||
set theText to title of active tab of first window | ||
set theURL to get URL of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Safari.app" and appIsRunning("Safari") then | ||
set theResult to run script "tell application id \"com.apple.safari\" | ||
set theTab to front document | ||
set theText to name of theTab | ||
set theURL to URL of theTab | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if {"Safari Technology Preview.app", "SafariTechnologyPreview.app"} contains theApplication and appIsRunning("Safari Technology Preview") then | ||
set theResult to run script "tell application id \"com.apple.SafariTechnologyPreview\" | ||
set theTab to front document | ||
set theText to name of theTab | ||
set theURL to URL of theTab | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Chromium.app" and appIsRunning("Chromium") then | ||
set theResult to run script "tell application \"Chromium\" | ||
set theURL to URL of active tab of first window | ||
set theText to title of active tab of first window | ||
return {theURL, theText} | ||
end tell" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "qutebrowser.app" and appIsRunning("qutebrowser") then | ||
set theResult to run script "tell application id \"org.qt-project.Qt.QtWebEngineCore\" | ||
activate | ||
end tell | ||
tell application \"System Events\" | ||
set myApp to name of first application process whose frontmost is true | ||
if myApp is \"qutebrowser\" then | ||
set scriptPath to quoted form of \"_path_to_qutebrowser_script_\" | ||
tell application \"System Events\" | ||
keystroke \":spawn --userscript \" & scriptPath & \"/qutebrowser-info.sh\" | ||
key code 36 | ||
end tell | ||
end if | ||
end tell | ||
delay 10 | ||
set userscriptOutput to get the clipboard | ||
set myList to paragraphs of userscriptOutput | ||
return myList" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if theApplication is "Firefox.app" and appIsRunning("Firefox") then | ||
set theResult to run script "tell application id \"org.mozilla.firefox\" | ||
activate | ||
set w to item 1 of window 1 | ||
set theText to name of w | ||
end tell | ||
tell application \"System Events\" | ||
set myApp to name of first application process whose frontmost is true | ||
if myApp is \"Firefox\" then | ||
tell application \"System Events\" | ||
key code 97 | ||
delay 0.5 | ||
keystroke \"c\" using command down | ||
end tell | ||
delay 0.5 | ||
end if | ||
delay 0.5 | ||
end tell | ||
set theURL to get the clipboard | ||
return {theURL, theText}" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
else if {"Firefox Developer Edition.app", "FirefoxDeveloperEdition.app"} contains theApplication and appIsRunning("Firefox") then | ||
set theResult to run script "tell application id \"org.mozilla.firefoxdeveloperedition\" | ||
activate | ||
set w to item 1 of window 1 | ||
set theText to name of w | ||
end tell | ||
tell application \"System Events\" | ||
set myApp to name of first application process whose frontmost is true | ||
if myApp is \"Firefox\" then | ||
tell application \"System Events\" | ||
keystroke \"l\" using command down | ||
delay 0.5 | ||
keystroke \"c\" using command down | ||
end tell | ||
delay 0.5 | ||
end if | ||
delay 0.5 | ||
end tell | ||
set theURL to get the clipboard | ||
return {theURL, theText}" | ||
set theURL to item 1 of theResult | ||
set theText to item 2 of theResult | ||
|
||
end if | ||
|
||
return {theURL & " fd850fc2e63511e79f720023dfdf24ec " & theText} | ||
|
||
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
on appIsRunning(appName) | ||
tell application "System Events" to (name of processes) contains appName | ||
end appIsRunning | ||
|
||
|
||
on run | ||
delay 2 | ||
set theApplication to (name of (info for (path to frontmost application))) | ||
set supportedBrowser to true | ||
|
||
if theApplication is "qutebrowser.app" and appIsRunning("qutebrowser") then | ||
set supportedBrowser to false | ||
|
||
else if theApplication is "Firefox.app" and appIsRunning("Firefox") then | ||
set supportedBrowser to false | ||
|
||
else if {"Firefox Developer Edition.app", "FirefoxDeveloperEdition.app"} contains theApplication and appIsRunning("Firefox") then | ||
set supportedBrowser to false | ||
|
||
end if | ||
|
||
return supportedBrowser | ||
|
||
end run |
Oops, something went wrong.