Skip to content

Commit

Permalink
Release version 0.15.10
Browse files Browse the repository at this point in the history
- Address issue #47
- Add Microsoft Edge support
- Don't use 'sed' hack to set user name
  • Loading branch information
spamwax committed Mar 12, 2020
1 parent d432142 commit 2505a1a
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 48 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.15.10] - 2020-03-12
### Fixed
- Trying to address issue [#47](https://github.com/spamwax/alfred-pinboard-rs/issues/47) (Catalina osascript premissions)
### Added
- Suport Microsoft Edge Browser
### Changed
- Don't use 'sed' hack to pass username to URL on pinboard (which will be overwritten on new updates).
- Don't use `sed` hack to set username for url search on [pinboard](https://pinboard.in). A `username` environment variable is now passed to Alfred.

## [0.15.8] - 2019-08-29
### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
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]
Expand Down
1 change: 1 addition & 0 deletions create_alfred_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ git add res/images
git add Cargo.toml
git add CHANGELOG.md
git add README.md
git add Cargo.lock

commit_msg="Release version $version_tag"
[ -n "$msg" ] && commit_msg="$commit_msg
Expand Down
174 changes: 174 additions & 0 deletions res/workflow/get-current-url.applescript.bak
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
24 changes: 24 additions & 0 deletions res/workflow/identify-browser.applescript
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
Loading

0 comments on commit 2505a1a

Please sign in to comment.