Applescript, Clipboard, Libraries and Stand-alones

Thomas McGrath III 3mcgrath at comcast.net
Tue May 6 12:54:20 EDT 2008


I need to find out the answer to this one!

I am using an Applescript from within Revolution that sets the  
clipboard to an image that the Applescript fetches.
The script looks like the one below, where <name> , <playlist> and  
<application> are replaced from the Revolution side. The name and  
playlist are the names of the track and playlist and the application  
is (I assume) the one that is calling the applescript??? But the  
command and paste are sent from one stack to another (the other is a  
library stack).

The entry for the clipboard states:          set the clipboard to v :  
Place data on an application’s clipboard. Use inside a ‘tell’ block  
and activate the application first


try
	tell application "iTunes"
		set myTrackKind to the kind of artwork 1 of track "<name>" of  
playlist "<playlist>"
		if myTrackKind is 0 then
			set myTrack to the (data of artwork 1 of track "<name>" of playlist  
"<playlist>") as picture
		end if
	end tell
	tell application "<application>"
		activate
		set the clipboard to myTrack as picture
	end tell
end try

The problem is that when a stack or substack is set as the  
"<application>" the script does not work. When Revoution is set as the  
"<application>" it still does not work. The AS entry states that the  
applications clipboard needs to be active first but I have tried the  
Library, the Stack and Revolution (From within the IDE) and no  
luck......


Any ideas here???

Tom McGrath




More information about the use-livecode mailing list