Re: Scripting Palm Desktop
Re: Scripting Palm Desktop
- Subject: Re: Scripting Palm Desktop
- From: "Jason W. Bruce" <email@hidden>
- Date: Mon, 04 Mar 2002 11:00:57 -0600
Hi Phi,
I think it has always been the case that the window containing the
body of a memo must be updated in order for the contents to become visible
-- which you can do by going to the previous memo and coming back again.
Rather than capturing the result of create memo in vMemo, see if the
following construct works. I've never had a problem with it.
Tell application "Palm Desktop"
create new new memo with {title: vTitle, body:vClip}
end tell
HTH,
Jason Bruce
Phi Sanders wrote:
>
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.