Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene / Dae committed Nov 23, 2014
0 parents commit de8d394
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.app
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
APP_NAME="Force Paste.app"

rm -rf "$APP_NAME"
osacompile -o "$APP_NAME" -x "main.scpt"
/usr/libexec/PlistBuddy -c "Add NSUIElement String 1" "$APP_NAME/Contents/Info.plist"
/usr/libexec/PlistBuddy -c "Set CFBundleIconFile icon" "$APP_NAME/Contents/Info.plist"
rm -f "$APP_NAME/Contents/Resources/applet.icns"
cp "icon.icns" "$APP_NAME/Contents/Resources/"
Binary file added icon.icns
Binary file not shown.
16 changes: 16 additions & 0 deletions main.scpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set numbers_key_codes to {29, 18, 19, 20, 21, 23, 22, 26, 28, 25}

set input to do shell script "pbpaste"

if (input is not missing value) then
tell application "System Events"
repeat with char in the characters of input
try
set test to char as number
key code numbers_key_codes's item (char + 1)
on error
keystroke char
end try
end repeat
end tell
end if

0 comments on commit de8d394

Please sign in to comment.