Calling Other AppleScript files and Maximizing iTunes Window Help

I’m really starting to figure things out with AppleScript.

If I had Multiple AppleScript files e.g. One.applescript, Two.applescript, etc…

Could I call them in say Main.applescript by using

#include "One.applescript"

Also, I can maximize the iPhoto window but when it comes to iTunes it does not work the same. I have two different methods that work with iPhoto

	on setScreenRes_()
		tell application "Finder"
			set dis_res to bounds of window of desktop
			set dis_width to item 3 of dis_res
			set dis_height to item 4 of dis_res
		end tell
	end setScreenRes_


on setiPhoto_()
		tell application "iPhoto"
			set bounds of window 1 to {0, 0, dis_width, dis_height}
		end tell
	end setiPhoto_

This does not work the same with iTunes. It gives me “iTunes got an error: A descriptor type mismatch occurred.” I do not know what this means. Any help would be great. Thanks again all.

Use this for accessing a classes handlers:

Add to your script:

property two : missing value

Drag a blue cube from the IB library to the xib window, go to it’s identity inspector then change the class to yours, it will be in the drop down. Now control drag from the new cube to the appdelegate and choose property you just created e.g. two.

Now in your code use:

two's yourhandlerintwo()

Note you must have an underscore in handlers like in cocoa e.g.


must become

handler__ (val1,val2)


handlerval1_val2_ (val1,val2)

if you prefer.

Is that what you meant?

That does help out quite a bit actually. All I needed was a little insight to get my head back on track. Thanks Richard.