Skip to content

Commit

Permalink
Consider case when checking giphy/gif me command.
Browse files Browse the repository at this point in the history
  • Loading branch information
danasilver committed Aug 27, 2015
1 parent fda8f38 commit 6ad62fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions GiphyMessages/GiphyMessages/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3</string>
<string>1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4</string>
<string>5</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.entertainment</string>
<key>LSMinimumSystemVersion</key>
Expand Down
24 changes: 13 additions & 11 deletions GiphyMessages/GiphyScripts/Giphy.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@
using terms from application "Messages"
on message sent theMessage for theChat with theText
set theChatId to (get id of theChat)

if theMessage starts with "gif me" or theMessage starts with "giphy" then
try
set theQuotedMessage to quoted form of theMessage
set theQuotedChatId to quoted form of theChatId
set theScript to "/Applications/Giphy\\ Messages.app/Contents/Resources/giphy.py"

do shell script "python " & theScript & " " & theQuotedMessage & " " & theQuotedChatId & " &>/dev/null &"
on error err
end try
end if

considering case
if theMessage starts with "gif me" or theMessage starts with "giphy" then
try
set theQuotedMessage to quoted form of theMessage
set theQuotedChatId to quoted form of theChatId
set theScript to "/Applications/Giphy\\ Messages.app/Contents/Resources/giphy.py"

do shell script "python " & theScript & " " & theQuotedMessage & " " & theQuotedChatId & " &>/dev/null &"
on error err
end try
end if
end considering

return theMessage
end message sent
Expand Down

0 comments on commit 6ad62fd

Please sign in to comment.