Created
November 27, 2019 19:35
-
-
Save MLKrisJohnson/d13b0652d95300b0685207b7ecb3dfae to your computer and use it in GitHub Desktop.
AppleScript that directs Terminal to tail a log file and apply a filter to it.
This file contains hidden or 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
-- Opens a new terminal window displaying MobileLabs.DeviceConnect.Services.log | |
-- Relies on these definitions in ~/.bashrc: | |
-- | |
-- alias filter-mllog='sed -e '\''s/MobileLabs/ML/g'\'' -e '\''s/DeviceConnect/DC/g'\'' -e '\''s/AirStream/AS/g'\'' -e '\''s/Gateway/Gw/g'\'' -e '\''s/Services/Sv/g'\'' -e '\''s/Framework/Fw/g'\' | |
-- alias tail-services='tail -F /Users/kris/.dcdata/Logs/MobileLabs.DeviceConnect.Services.log | filter-mllog' | |
tell application "Terminal" | |
set newTab to (do script "tail-services") | |
tell newTab | |
set custom title to "Services Log" | |
end tell | |
-- TODO: We should really find the window that contains newTab, but it's easy to just assume it's now "window 1" | |
tell window 1 | |
set position to {0, 20} | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment