Created
August 31, 2014 16:58
-
-
Save nsmaciej/4f1b558c082f205e72eb to your computer and use it in GitHub Desktop.
Emoticon formatter v1
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
# Setup variables - chnage this to whatevery you want | |
set emoticon_shape to " | |
* * * *** | |
* * ** | |
*** * ** | |
* * * | |
* * * *" | |
set emoticon_char to "(bow)" | |
set match_length to 3 | |
set message_target to "username" | |
set script_name to "shaper" | |
# Repeat a string multiple times | |
on repeat_string(istring, notimes) | |
set final to istring | |
repeat notimes - 1 times | |
set final to final & istring | |
end repeat | |
return final | |
end repeat_string | |
# Emoticonify the shape | |
set new_shape to "" | |
set new_line to " | |
" | |
repeat with char in emoticon_shape | |
set to_append to repeat_string(" ", match_length) | |
if (char as string = "*") then # Special case for stars | |
set to_append to emoticon_char | |
else if (char as string = new_line) then # Special case for newline | |
set to_append to new_line | |
end if | |
set new_shape to new_shape & to_append | |
end repeat | |
# Actaully send the message | |
tell application "Skype" | |
send command "MESSAGE " & message_target & " \"" & new_shape & "\"" script name script_name | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment