Send variables back to Rev from Applescript
Ken Ray
kray at sonsothunder.com
Fri Aug 20 14:06:04 EDT 2004
On 8/20/04 11:05 AM, "Marian Petrides" <mpetrides at earthlink.net> wrote:
> tell application "Palm Desktop"
>> set numberOfMemos to count of memos
>> set memoMemos to {}
>> set loopIndex to 1
>>
>> -- find all Memo Pad Memos (memos with no attachments) and put
>> them
>> in memoMemos
>> repeat numberOfMemos times
>> set theMemo to item loopIndex of memos
>> if (count of attachments of theMemo) is 0 then
>> set end of memoMemos to theMemo
>> end if
>> set loopIndex to loopIndex + 1
>> end repeat
>> return loopIndex
>> end tell
Marian, I got Palm Desktop and tried the code in Script Editor and got an
access error in trying to access the memo with "item loopIndex of memos".
When I changed the code to this:
tell application "Palm Desktop"
set numberOfMemos to count of memos
set memoMemos to {}
set loopIndex to 1
-- find all Memo Pad Memos (memos with no attachments) and put them in
memoMemos
repeat with x from 1 to numberOfMemos
set theMemo to memo x
if (count of attachments of theMemo) is 0 then
set end of memoMemos to theMemo
end if
set loopIndex to loopIndex + 1
end repeat
return loopIndex
end tell
It worked in Script Editor. I then tried it by pasting it into a Rev field
and did "do fld 1 as applescript;put the result" and it came back with the
same number.
Try it on your end...
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com
More information about the use-livecode
mailing list