ClipboardData Refresh

Kay C Lan lan.kc.macmail at gmail.com
Thu Jun 21 05:43:18 EDT 2007


On 6/21/07, Jim Ault <JimAultWins at yahoo.com> wrote:
>
>
> Also, the clipboarddata in Rev does not reliably update when doing the
> switch to frontmost.  In the past, I have written some Applescripts to
> take
> advantage the clipboard, and proved that it was unreliable.  In fact, just
> proved it again yesterday for a different project.


I'll second that. Created an Automator app that worked with the
clipboardData but even though the data successfully made it into Rev (If I
used the menu Paste the data would end up in the field) there was no way I
could do it with a script :-(

Depending on your needs I was able to work around this. In my case I needed
to open files that were in a format Rev could not understand so I needed a
third party program to convert them. I then wanted to copy that to the
clipboard, then in Rev put the data into a variable for further processing.
As the clipboard was unreliable what I ended up doing was put the data into
a file and then have Rev open the file. So the process was basically:

Rev asked for the folder that contained the files that needed to be worked
on.
Rev went into a loop for each file x
Rev asked an Automator app to run
Automator asked third party app to open file x
Automator asked third party app to convert file x
Automator saved file x in a specified location with an unchanging name
Rev Opened the file and did it's thing
Rev closed the file
Rev deleted the file
Rev when back to the beginning of the loop

In my case there were lots of large files and I needed the entire contents
so a 1:1 ratio was best. In your case, if the clipboardData is small, maybe
you could look at using AppleScript to append the data to a single file and
then read the file with Rev at the end.

Hope there's something there that might help skin your particular cat. It's
obvious though that others have faced a similar dilemma and worked around it
somehow.



More information about the use-livecode mailing list