Scripting Palm Desktop
Scripting Palm Desktop
- Subject: Scripting Palm Desktop
- From: Phi Sanders <email@hidden>
- Date: Sat, 2 Mar 2002 21:39:05 -0500
I'm trying to write a script to put the clipboard into a memo in palm
desktop. What I've pasted below does not error, but does not properly set
the body of the memo... I'm on OS X 10.1.3 with AS 1.8.1 and Palm desktop
4.0b77
Sometimes the body gets set, sometimes it does not - on the exact same
clipboard contents! Sometimes the memo does not appear to have the proper
body contents until it is closed and reopened (not very reassuring...) Is
this a known problem? Workaround?
Also, is there a way to supress the opening of the newly created memo?
Thanks in advance,
~Phi
-- ===========================================================
-- Save Clipboard to Memo.scpt
-- ===========================================================
try
set vClip to the clipboard as text
set vClipCount to the count of vClip
if (vClipCount > 0) then
set vBtn to {"Cancel", "Save as Palm Memo"}
set vTitle to (characters 1 thru 30 of vClip) as string
set vSubstring to (characters 31 thru 60 of vClip) as string
set vExample to vTitle & return & vSubstring & "..." & return
set vPrompt to vExample & return & "Please specify a title for the memo"
set vAns to (display dialog vPrompt default answer vTitle buttons vBtn
default button 2)
-- if user clicks cancel nothing else will happen
set vTitle to text returned of vAns
--make the memo
tell application "Palm Desktop"
set vMemo to (create new memo)
set title of memo vMemo to vTitle
set body of memo vMemo to vClip
end tell
else
--no data to record, quietly exit
end if
on error eMsg number eNum
set vError to "Error" & return & eMsg & return & eNum & return
display dialog vError buttons {"Exit"} default button 1
end try
-- ===========================================================
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.