From a25fcb9e6ef80efa8db0e6d349618bfd49a9b2e5 Mon Sep 17 00:00:00 2001 From: Christian Mittendorf Date: Mon, 26 Oct 2015 09:29:44 +0100 Subject: [PATCH 1/3] add AppleScript commands for accessing the current web page shown in Safari --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index e802df5..0674df3 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,13 @@ defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebK defaults write NSGlobalDomain WebKitDeveloperExtras -bool true ``` +#### Get the current Web Page as Source, Text or URL +```bash +osascript -e 'tell application "Safari" to get source of current tab of front window' +osascript -e 'tell application "Safari" to get text of current tab of front window' +osascript -e 'tell application "Safari" to get URL of current tab of front window' +``` + ### Sketch #### Export Compact SVGs From 0cd566d22c7dbfff7de591bfeb84fe23ae0dc9a7 Mon Sep 17 00:00:00 2001 From: Christian Mittendorf Date: Tue, 27 Oct 2015 08:24:06 +0100 Subject: [PATCH 2/3] Updated title and description --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0674df3..ed5da50 100644 --- a/README.md +++ b/README.md @@ -158,10 +158,9 @@ defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebK defaults write NSGlobalDomain WebKitDeveloperExtras -bool true ``` -#### Get the current Web Page as Source, Text or URL +#### Get Current Page Data +Use ```get source``` or ```get text``` for the html source or text content. ```bash -osascript -e 'tell application "Safari" to get source of current tab of front window' -osascript -e 'tell application "Safari" to get text of current tab of front window' osascript -e 'tell application "Safari" to get URL of current tab of front window' ``` From 997f877b98ede195bfa678f88b38b2ffa0ae26ad Mon Sep 17 00:00:00 2001 From: Christian Mittendorf Date: Thu, 29 Oct 2015 09:43:59 +0100 Subject: [PATCH 3/3] Changed backticks to a single one for inline code --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed5da50..4c199a6 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ defaults write com.apple.universalaccess reduceTransparency -bool false #### Set Wallpaper -Up to Mountain Lion: +Up to Mountain Lion: ```bash osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/path/to/picture.jpg"' @@ -159,7 +159,7 @@ defaults write NSGlobalDomain WebKitDeveloperExtras -bool true ``` #### Get Current Page Data -Use ```get source``` or ```get text``` for the html source or text content. +Use `get source` or `get text` for the html source or text content. ```bash osascript -e 'tell application "Safari" to get URL of current tab of front window' ```