moving content of variable
doug rogers
dougrogers1 at mac.com
Fri Dec 17 16:35:22 EST 2004
On 17-Dec-04, at 3:29 PM, J. Landman Gay wrote:
>> Which object do I address the copy/set command? Revolution doesn't
>> have the dictionary to Get, Set or Copy.
>
> I haven't worked much with this, so I'm just guessing, but I bet you
> have to build a statement using "do". For example:
>
> put "tell application" &"e& "HyperCard" "e&& "to copy" &&
> theItems && "to theItems" into myScript
> do myScript as AppleScript
>
> I think that should work. Rev supports only the "dosc" appleevent for
> script executions.
:-) There is light at the end of this tunnel... but I can't tell if
it's the exit or an oncoming train :-)
babbling on...
the 'tell application Hypercard' etc works just fine and it explains
why HyperCard was launching when called from the script from
Revolution, but at this point, HyperCard doesn't know anything about
the variable because all the content is in Revolution. How do I get it
out of Rev and into the applescript variable?
tell application "Revolution" to copy card field "theItems" to theItems
would be ideal.
and even if I wrote a script in Transcript and called it from
Applescript as a dosc event, still doesn't transfer the content of the
variable (?)
perhaps some kind of function, parameters, or clipboard thing....
so I've tried setting the clipboarddata["text"], but the applescript
balks at getting the clipboard, or I am not calling the applescript
correctly.
The Transcript:
on mouseUp
put card field "TheItems" into TheItems
answer TheItems &&"1" -- just to test that it was working
repeat while last char of TheItems is return
delete last char of TheItems
end repeat
set the clipboardData["text"] to TheItems
--tell application "HyperCard" to copy variable "TheItems" to TheItems
-- was launching HyperCard in Classic, perhaps responsible for Rev's
crashes
do card field "TheItems" as Applescript
--do the SendListToiCal of me as applescript -- don't know if this
works as I am working with the card field script
put empty into TheItems
put empty into card fld "TheItems"
end mouseUp
the Applescript:
display dialog the clipboard & " 2" --nada no response nothing
--set TheItems to the clipboard
--display dialog TheItems &" 3"
set AppleScript's text item delimiters to {return} --probably have to
deal; with this 10/13 thing later
set TheItems to text items of TheItems
set AppleScript's text item delimiters to {","}
set TheItems to text items of TheItems
set AppleScript's text item delimiters to {""}
tell application "iCal"
repeat with m from 1 to (count of TheItems)
set the NewToDo to make new todo at the end of the todos of the
calendar 5 with properties {due date:(current date), priority:3,
summary:(item m of TheItems)}
end repeat
end tell
There is a crack in everything. That's how the light gets in.
__________<http://home.golden.net/~samu>__________
More information about the use-livecode
mailing list