From a25fcb9e6ef80efa8db0e6d349618bfd49a9b2e5 Mon Sep 17 00:00:00 2001 From: Christian Mittendorf Date: Mon, 26 Oct 2015 09:29:44 +0100 Subject: [PATCH] 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