Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a new Sticky widget from entered text' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a new Sticky widget from entered text
Authored by: Sesquipedalian on May 29, '09 12:15:21PM
Replacing
set stickywidget to ((path to startup disk) as Unicode text) & "Library:Widgets:Stickies.wdgt"
tell application "Finder" to open stickywidget
with
do shell script "open /Library/Widgets/Stickies.wdgt"
will execute faster, and allow you to reduce the one second delay to something short like 0.2 seconds, and (at least on my machine) eliminate the two later delays.

Also, if you want to make sticky widgets without affecting the contents of the clipboard, use this version instead:

set inputText to text returned of (display dialog "Enter some text for your new Sticky widget..." default answer "Note: ")

do shell script "open /Library/Widgets/Stickies.wdgt"
delay 0.2
tell application "System Events"
   keystroke tab
   --delay 0.2 --add this back in if you need it
   keystroke tab
   --delay 0.2 --add this back in if you need it
   keystroke inputText
end tell

For Quicksilver users here is a version that works directly with text entered into Quicksilver's first pane (thus eliminating the need for a dialog box):

using terms from application "Quicksilver"
	on process text inputText
		do shell script "open /Library/Widgets/Stickies.wdgt"
		delay 0.2
		tell application "System Events"
			keystroke tab
			--delay 0.2
			keystroke tab
			--delay 1
			keystroke inputText
		end tell
	end process text
end using terms from

Finally, for people who think in the opposite order (open a Sticky, then type the text), but are tired of how much work it takes to create a new sticky note in Dashboard, I suggest trying New Sticky. (Yeah, I made it, but its freeware, so I feel no shame in plugging for it!)

[ Reply to This | # ]