scripting for mac laptops made into picture frames...

Hi,

I have dissasembled three 233Mhz G3 mac laptops purchased on Ebay, and then reassembled them into picture frames to hang on the wall. Its a rather enjoyable task. I have lsucessfully oaded OSX 10.4.9 onto them using some of the shareware bits out there and now have 3rd party (Netgear) airport cards working on them as well. These make nice gifts by the way for your MacPals who already have everything else…

These picture-frame machines turn on and off everyday on thier own, thus applescript is an important tool for these toys. So far I have been running slideshows on them using “GraphicsConverter” as they are bit too slow for iPhoto’s quicktime based transtions between slides. GraphicsConverter seems to have better fades on these slow machines.

Now I want to get a bit more fancy, and I am lookig for advice. (this is where you come in!!!)

I want to show a folder of images using “GraphicsConverter” and then turn on “DashBoard.” Dasboard is super for this because its a great way to show a selction of weather, stock quotes, the phase of the moon, news etc. Then after a delay of say 20 seconds, I want to go back and show the picture slides again using GraphicConverter. The script I use to do this is below.

The silly thing I am having trouble doing is getting Dashboard to turn off cleanly before going back and showing the slides again! Dashboard is very hard to get off the screen with AppleScript! Dahsboard has no commands of its own to end it… I cannot seem to pass the finder mouse click through applescript to get it to turn off poperly! All a bit frustrating…

Demos of graphicconverter can be downloaded through the web if you like.

Any ideas? ( I thougt of trying to send the keystroke for F12 to Dashboard -which turns it on and off – but there is no ASCII equivilent for this in applescript --or is there???)


--pass a desginated folder of images to the application called graphics converter
--designate  your  own file of pictures here
set this_folder to ("/Users/Paul/Picture Frame Mod software/picsa") as string
tell application "System Events"
	set these_files to every file of folder this_folder
end tell
repeat with i from 1 to the count of these_files
	set this_file to (item i of these_files as alias)
	set this_info to info for this_file
	if visible of this_info is true and alias of this_info is false then
		-- insert actions here for: this_file
		tell application "GraphicConverter"
			activate
			slideshow this_file
		end tell
	end if
end repeat


-- when the list of files in the directory is exhausted, start dashboard 
tell application "Finder"
	activate
	open application file "Dashboard.app" of folder "Applications" of startup disk
end tell

------------------------
-- delay for a while in order to display the contents  of whatever Dashboard is set to show
delay 5

------------------------
--go back to showing slides again (rerun graphicsconverter)
--(this all goes into a continuous loop forever in the real copy)
--designate  your  own file of pictures here
set this_folder to ("/Users/Paul/Picture Frame Mod software/picsa") as string
tell application "System Events"
	set these_files to every file of folder this_folder
end tell
repeat with i from 1 to the count of these_files
	set this_file to (item i of these_files as alias)
	set this_info to info for this_file
	if visible of this_info is true and alias of this_info is false then
		-- insert actions here for: this_file
		tell application "GraphicConverter"
			activate
			slideshow this_file
		end tell
	end if
end repeat




For some odd reason GC will not run a Slideshow on my mac??

So I will not be able to test it.

Looking at an Apple example GC should be able to just look at the folder.
To get the Keystroke, I just changed the key from F12 to Control + q. This you can do in the system Prefs.
In the Keyboard and mouse settings. Just click the hotkey for dashboard and enter you new one.


my RunSlide()
on RunSlide()
	set this_folder to alias "Macintosh HD:Users:USERNAME:Desktop:Images:" as string
	tell application "GraphicConverter"
		activate
		slideshow this_folder
	end tell
	
end RunSlide

tell application "System Events"
	keystroke "q" using {control down}
	delay 5
	keystroke "q" using {control down}
end tell
my RunSlide()

Just worked out the Key Code for F12

keystroke (key code 111)

I think you’ll find that the keystroke part isn’t required, Mark:

tell application "System Events" to key code 111

Cheers kai.