|
|
Create Palm Desktop memo entry from ANY app
The way to get this to work from any app is to require the user to first hit Cmd+C to put the selection into the clipboard. then you can just use this script. (There is no universal way in AppleScript to get at the selection in any and every app-- even with UI scripting):
set selectedText to do shell script "pbpaste"
display dialog "Enter a title for your memo: " ¬
default answer "" default button "OK"
set titleText to text returned of result
set confirmationMessage to "This is your new memo
Title: " & titleText & "
Body: " & selectedText
display dialog the confirmationMessage ¬
buttons {"Cancel", "Send to Palm memo"} ¬
default button 2 with icon 1 giving up after 10
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:selectedText}
on error msg
display dialog msg
end try
end tell
end if
Look out for line breaks!
Create Palm Desktop memo entry from ANY app
Thanks for the script. Hope to get it working since it could become quite useful.
Create Palm Desktop memo entry from ANY app
as is, this script won't work. The reason is Unicode -- PD doesn't support Unicode, so you have to extract plain text out of the selection. Look out for the following line in the original script I wrote
Create Palm Desktop memo entry from ANY app
Ahh, thanks for the explanation. I figured there was a good reason for doing that.
Create Palm Desktop memo entry from ANY app
Keep in mind that many of us are not applescripters, so when you say "Watch the line breaks" many of us aren't quite sure what you mean. Should the script match exactly what is shown on the html page, including the "¬", or should they be deleted to make one line. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|