renaming bin to applescripts
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
if application "iTunes" is running then
|
||||
tell application "iTunes"
|
||||
if exists current track then
|
||||
set theName to the name of the current track
|
||||
set theArtist to the artist of the current track
|
||||
try
|
||||
return "♫ " & theName & " - " & theArtist
|
||||
on error err
|
||||
end try
|
||||
end if
|
||||
end tell
|
||||
end if
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/usr/bin/osascript
|
||||
property defaultAccount : "Pollen"
|
||||
property defaultMailbox : "INBOX"
|
||||
|
||||
on run args
|
||||
set justUnread to false
|
||||
set theAccount to missing value
|
||||
set theMailbox to missing value
|
||||
|
||||
if defaultAccount = missing value then set defaultAccount to "-g"
|
||||
if defaultMailbox = missing value then set defaultMailbox to "INBOX"
|
||||
|
||||
set theCount to the count of args
|
||||
|
||||
if theCount > 0 then
|
||||
if item 1 of args = "-u" then
|
||||
set justUnread to true
|
||||
set theCount to theCount - 1
|
||||
set args to the rest of args
|
||||
else if item 1 of args = "-ug" or item 1 of args = "-gu" then
|
||||
set justUnread to true
|
||||
set item 1 of args to "-g"
|
||||
else if theCount > 1 and ¬
|
||||
item 1 of args = "-g" and item 2 of args = "-u" then
|
||||
set justUnread to true
|
||||
set theCount to theCount - 1
|
||||
set args to the rest of args
|
||||
set item 1 of args to "-g"
|
||||
end if
|
||||
end if
|
||||
|
||||
tell application "Mail"
|
||||
if theCount = 0 then
|
||||
set theAccount to defaultAccount
|
||||
set theMailbox to defaultMailbox
|
||||
else if theCount = 1 then
|
||||
set theAccount to item 1 of args
|
||||
set theMailbox to defaultMailbox
|
||||
else if theCount = 2 then
|
||||
set theAccount to item 1 of args
|
||||
set theMailbox to item 2 of args
|
||||
else
|
||||
error character id 10 ¬
|
||||
& "Usage: inbox-count [-u] [[account] mailbox]" & character id 10 ¬
|
||||
& " inbox-count [-u] -g [mailbox]"
|
||||
end if
|
||||
|
||||
set mailboxValue to missing value
|
||||
if theAccount = "-g" then
|
||||
if theMailbox = "INBOX" then
|
||||
set mailboxValue to inbox
|
||||
else
|
||||
set mailboxValue to mailbox theMailbox
|
||||
end if
|
||||
else
|
||||
set mailboxValue to mailbox theMailbox of account theAccount
|
||||
end if
|
||||
|
||||
if justUnread then
|
||||
return the unread count of mailboxValue
|
||||
else
|
||||
return the count of messages of mailboxValue
|
||||
end if
|
||||
end tell
|
||||
end run
|
||||
@@ -1,10 +0,0 @@
|
||||
if application "Rdio" is running then
|
||||
tell application "Rdio"
|
||||
set theName to name of the current track
|
||||
set theArtist to artist of the current track
|
||||
try
|
||||
return "♫ " & theName & " - " & theArtist
|
||||
on error err
|
||||
end try
|
||||
end tell
|
||||
end if
|
||||
@@ -1,12 +0,0 @@
|
||||
if application "Spotify" is running then
|
||||
tell application "Spotify"
|
||||
set theName to name of the current track
|
||||
set theArtist to artist of the current track
|
||||
set theAlbum to album of the current track
|
||||
set theUrl to spotify url of the current track
|
||||
try
|
||||
return "♫ " & theName & " - " & theArtist
|
||||
on error err
|
||||
end try
|
||||
end tell
|
||||
end if
|
||||
Reference in New Issue
Block a user