moving content of variable

Ken Ray kray at sonsothunder.com
Sat Dec 18 01:42:04 EST 2004


On 12/17/04 3:35 PM, "doug rogers" <dougrogers1 at mac.com> wrote:

> 
> 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" &&quote& "HyperCard" &quote&& "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 :-)

Try this... put this in a button:

on mouseUp
  put "Call Mom,Buy groceries" into tSubjects
  put "3" into tPriority
  
  put "tell application `iCal`" & cr & \
      "copy `"  & tSubjects & "` to TheItems" & cr & \
      "set AppleScript's text item delimiters to {`,`}" & cr & \
      "set TheItems to text items of TheItems" & cr & \
      "repeat with m from 1 to (count of TheItems)" & cr & \
      "set the NewToDo to make new todo at the end of the todos" && \
      "of the calendar 1 with properties {due date:(current date)," && \
      "priority:" & tPriority & ", summary:(item m of TheItems)}" & cr & \
      "end repeat" & cr & \
      "end tell" into tAS
  
  replace "`" with quote in tAS
  do tAS as AppleScript
end mouseUp

This is how I work with AppleScript - I substitute left angle quotes for
real quotation marks while building the script and replace them with quotes
later, and I try to format it with the same line breaks as it would be if it
were being typed (note the \ line continuation characters).

Hope this gives you some insight on how to work with AppleScript in Rev...

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