Skip to content

Instantly share code, notes, and snippets.

View xenatt's full-sized avatar

Nattapong Pullkhow xenatt

View GitHub Profile
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Tweetbot") then
tell application "Tweetbot" to activate
end if
if not (exists application process "iTunes") then
--Original form
-- TweetViaTwitter.applescript
-- Copy title and URL in the front most window of Safari to Twitter with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Wedge") then
tell application "Wedge" to activate
end if
if not (exists application process "iTunes") then
tell application "iTunes" to activate
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Wedge") then
tell application "Wedge" to activate
end if
if not (exists application process "iTunes") then
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Appetizer") then
tell application "Appetizer" to activate
end if
if not (exists application process "iTunes") then
@xenatt
xenatt / FinderToTerminal.applescript
Last active December 16, 2015 16:19
Finder To Terminal License GPL
try
tell application "Finder" to set fdir to (target of front Finder window) as text
tell application "Terminal"
do script "cd " & (quoted form of POSIX path of fdir)
end tell
tell application "System Events"
set visible of process "Terminal" to true
set frontmost of process "Terminal" to true
end tell
on error errorMessage number errorNumber
@xenatt
xenatt / ShowDesktop.applescript
Created April 25, 2013 19:43
Show Desktop App license GPL
tell application "System Events"
repeat with X in application processes
if visible of X is true then
set visible of X to false
else
set visible of X to true
end if
end repeat
end tell
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Tweetdeck") then
tell application "TweetDeck" to activate
end if
if not (exists application process "iTunes") then
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Twitterrific") then
tell application "Twitterrific" to activate
end if
if not (exists application process "iTunes") then
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Janetter") then
tell application "Janetter" to activate
end if
if not (exists application process "iTunes") then
@xenatt
xenatt / iTunes_Geeklets.sh
Last active December 16, 2015 18:38
Shell script for iTunes Player status and Cover Geeklets Download http://xenatt.deviantart.com/art/MINIMAL-GEEKLETS-366032600
itnsps=`osascript -e "tell application \"System Events\"" -e "if (exists application process \"iTunes\") then" -e "return \"yes\"" -e "else" -e "return \"no\"" -e "end if" -e "end tell"`
lasttrack=`tail /tmp/itunestrack`
if [ "$itnsps" = "yes" ]
then
itnsplst=`osascript -e "tell application \"iTunes\"" -e "return (get player state as string)" -e "end tell"`
if [ "$itnsplst" = "playing" ]
then