Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

laur5730

macrumors newbie
Original poster
Oct 29, 2009
17
0
Is it possible to make a GUI to an AppleScript I wrote?

Because I want this is:

Code:
------------
|    [COLOR="Red"][3][/COLOR]    |       <--- My ultimate writing skill :)
|    [COLOR="Red"][5][/COLOR]    |
|    [COLOR="Red"][6][/COLOR]    |
|__[Start]__|

This is how the GUI should look like. 3 = X, 5 = Y, 6 = Z. So depends on what I wrote in my windows (The code) the script will change. Look in next code :)

Code:
tell application "TextEdit"
activate
end tell

set [COLOR="Red"]x[/COLOR] to 3
tell application "System Events"
repeat x times
keystroke "Hello"
keystroke return
end repeat
end tell

set [COLOR="Red"]y[/COLOR] to 5
tell application "System Events"
repeat y times
keystroke "Hey there!"
keystroke return
end repeat
end tell

set [COLOR="Red"]z[/COLOR] to 6
tell application "System Events"
repeat z times
keystroke "Last One"
keystroke return
end repeat
end tell

The red text what is variable in this script/application :)

I hope very much this can be done. I have like 0.5% knowledge in AppleScript so I need to ask you gurus, hehe :p
 
When learning a language, it's best to follow a tutorial, rather than trying to do it entirely on your own. This is especially true if you know no other computer languages.

Code:
------------
|    [3]    |
|    [5]    |
|    [6]    |
|__[Start]__|
I can't tell what that's supposed to represent. Is it a window? If so what do the [3], [5], and [6] represent? Buttons? Selectable list items? Text-entry fields?
 
Code:
------------
|    [3]    |
|    [5]    |
|    [6]    |
|__[Start]__|
I can't tell what that's supposed to represent. Is it a window? If so what do the [3], [5], and [6] represent? Buttons? Selectable list items? Text-entry fields?

It represents a text-entry field that will effect the AppleScript for what I write in the field. If you want me to draw a picture to show, I can do that :)
 
AppleScript has limited GUI options. "Display dialog" and "choose from list" are about it.

If you're game, you can load Xcode (it's one of the optional installs on your OS X disk), which will give you full access to the operating system.

There are other "wrappers" like Pashua that provide more of a UI without having to learn Xcode.

mt
 
I see now there is something called AppleScript Studio which is Xcode and AppleScript. So I searched for guides how to handle events when a button is pressed. But it seems they have removed it. Look at link, that was in 2008 so it is outdated, but that was how you did it...

http://foolsworkshop.com/applescript/2008/05/activate-an-event-handler/
that was before but it seems the AppleScript tab is gone...

What should I do know to handle actions and events?

Thanks in advance
 
This is a good place to start.

An btw, if you're still trying to bot WOW, there's a good chance you'll get caught and be perma-banned.

I know there is a chance :D

Ups, I have read a little for that link, but it does not help me here :(
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.