Hi! Beginner here!

Hi I have been scripting in 10.5 since I converted to Mac :smiley: last summer. I always meant to start AppleScript Studio but I hadn’t the scripting skills till just before 10.6, I never imagined they would axe it! lol :lol: But I still want to make proper AS apps. I would like to extend some of my scripts on my imadrichard iDisk public folder, if you wanna look, especially my text editor (v2 on iDisk but I have a better v3 here but not compatible with other home folders… yet). I can just about work the Interface Builder except I can’t link buttons etc. to script, my script doesn’t seem to work in the AppleScript editor after building, I don’t understand the bits you get in a new project, something to do with starting and ending so I just delete them (don’t need to tell me that’s asking for trouble). Quite plainly… Help!

All help greatly appreciated.

Model: iMac bought last year.
Browser: Safari 4
Operating System: Mac OS X (10.6)

I had a try at that PartOne thing, didn’t work, I did exactly what it said, even copied the script in the end. No use.

There is a GUI building video at the top of this page that might help.

There are five tutorials in the unScripted section as well.

-hth

They are nice videos and stuff but it doesn’t explain anything. I see “'s” everywhere and sub routines that have no on statement like the makefirstresponder one, the only new bit I understand is the sub routines linked to actions… kind of… but then there are things on statements which are never called in script like the nib one.

Really? You went through all five tutorials and feel they do not explain anything?

makeFirstResponder
From the tutorial. I’m not sure how to explain this any better. We are sending the message “makeFirstResponder” to the NSWindow “aWindow.”

The “'s” are one way of sending messages to the object with the “s.” There are several ways to send messages and each developer tends to gravitate to one. Although you will see all of these methods scattered out through different posts and code samples.

Lesson five goes into more detail on how to convert Objective-C to AppleScriptObjC so you might want to look it over again. I will add some more tutorials with more detail on the basics.

Example.


script MyAdder
	on addNums(num_one, num_two)
		return num_one + num_two
	end addNums
end script

tell MyAdder to set a to addNums(5, 10)

tell MyAdder
	set b to addNums(5, 10)
end tell

set c to MyAdder's addNums(5, 10)
set d to addNums(5, 10) of MyAdder


{a, b, c, d} #=> result {15,15,15,15}

If none of this is making sense, and that’s ok, we’ve all been there, then may I suggest you go through the beginner tutorials on unScripted. I have a list of sources for learning AppleScript here.

Regards,

Craig

OK, sorry, I should have mentioned that I haven’t read all of tutorial 1 because I stopped reading where I got stuck and then decided to have a quick go at tutorial 2 because it was a different example which I thought would be different, it helped slightly. I stopped a “Build and go” because I did exactly what you said but it failed to build, even with copy/pasted code from here. Before more questions, why didn’t it build?

Zip up the project and email it to me. Hard to tell without looking at it.

craigw@macscripter.net

Weird, I trashed it after it didn’t work so I did it again now to send (I thought I did it the same) but this time it worked. :confused: Oh well… I’ll do the rest of the tutorial now. Thanks anyway.:D:D:D