forked from a4agarwal/dropzone-user-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreate Note with Text.dropzone
58 lines (45 loc) · 1.04 KB
/
Create Note with Text.dropzone
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/ruby
# Dropzone Destination Info
# Name: Create Note with Text
# Description: A new note will be created with the dropped text.
# Handles: NSStringPboardType
# Events: Dragged
# Creator: Aptonic Software
# URL: http://aptonic.com
# IconURL: http://aptonic.com/destinations/icons/note.png
def dragged
`echo \"#{$items[0]}\" | pbcopy`
`osascript <<END
tell application "Stickies" to activate
tell application "System Events"
tell process "Stickies"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
click menu item "New Note"
end tell
end tell
end tell
end tell
tell application "Stickies"
tell selection
try
set theClip to Unicode text of (the clipboard as record)
type class text text theClip
end try
end tell
end tell
tell application "System Events"
tell process "Stickies"
tell menu bar 1
tell menu bar item "Edit"
tell menu "Edit"
click menu item "Paste"
end tell
end tell
end tell
end tell
end tell
end tell
END`
end