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


Click here to return to the 'Create Palm Desktop memo entry from selection' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create Palm Desktop memo entry from selection
Authored by: Fofer on Dec 12, '03 01:45:13PM
Okay, I have tinkered with all of the sample scripts here and combined what I feel is the best of the bunch. I wanted it to work in all applications, so I went with the "copy to clipboard first" approach. I also wanted the script to ask me for a Memo Title (rather than having it simply use the first few letters of my copied text.) Finally, I wanted it to show me a preview before sending it to Palm Desktop... while truncating any "extra long" memos that would cause the Preview window to be longer than my screen. Here is the fruit of my labor... maybe next time I'll go the extra mile and figure out how to post AppleScripts as clickable links. :-)

set contentsText to the clipboard as string
set contentsText to «class ktxt» of (result as record)
display dialog ¬
	"Enter a title for your Palm Memo: " default answer "" default button "OK"
set titleText to text returned of result
set titleText to «class ktxt» of (result as record)


if (count of contentsText) > 300 then -- truncate the search pattern before writing it to the window title
	set ContentsTextPreview to ((text 1 thru 300 of contentsText) & "…")
else
	set ContentsTextPreview to contentsText
end if
set confirmationMessage to "Preview of new Memo:

Title: " & titleText & "
" & ContentsTextPreview

display dialog the confirmationMessage ¬
	buttons {"Cancel", "Send to Palm Memo"} ¬
	default button 2 with icon 1 giving up after 20

set userChoice to the button returned of the result
if userChoice is "Send to Palm Memo" then
	
	tell application "Palm Desktop"
		activate
		try
			make new memo with properties ¬
				{title:titleText, contents:contentsText}
		on error msg
			display dialog msg
		end try
	end tell
end if


[ # ]
Create Palm Desktop memo entry from selection
Authored by: sp on Dec 13, '03 05:00:48AM

Very nice! Now if we could just send direct to the Palm with BT...



[ # ]