i made a script that worked well in the applescript editor, but i’m trying to make it work in xcode. here is the Spammers AppDelegate script:
script SpammerAppDelegate
-- Inheritance
property parent : class "NSObject"
--IBOutlets
property myWindow : missing value
property theTextField1 : missing value
property theTextField2 : missing value
property theTextField3 : missing value
property myButton1 : missing value
property myButton2 : missing value
property myButton3 : missing value
property myButton4 : missing value
property myProgressBar : missing value
--IBActions
on buttonClickmyButton1_(sender)
set textToSay to "Sample Text"
set textToSay to theTextField1 to text returned of theTextField1
end buttonClickmyButton1_
on buttonClickmyButton2_(sender)
set int to theTextField2 to text returned of theTextField2
end buttonClickmyButton2_
on buttonClickmyButton3_(sender)
set numoftimes to text returned of theTextField3
end buttonClickmyButton3_
on buttonClickmyButton4_(sender)
display dialog "Wait 5 seconds..."
delay 5
repeat numoftimes times
delay int
keystroke return
keystroke textToSay
end repeat
end buttonClickmyButton4_
#####################################################
# Application
on awakeFromNib()
end awakeFromNib
on applicationWillFinishLaunching_(aNotification)
myProgressBar's setUsesThreadedAnimation_(true)
do shell script "mkdir ~/Desktop/dir1 ; sleep 0.5"
myProgressBar's incrementBy_(20)
do shell script "mkdir ~/Desktop/dir2; sleep 0.5"
myProgressBar's incrementBy_(20)
do shell script "mkdir ~/Desktop/dir3; sleep 0.5"
myProgressBar's incrementBy_(20)
do shell script "mkdir ~/Desktop/dir1/dir4; sleep 0.5"
myProgressBar's incrementBy_(20)
do shell script "mkdir ~/Desktop/dir2/dir5; sleep 0.5"
myProgressBar's incrementBy_(20)
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
the buttons don’t do anything and i don’t think the text fields do anything either lol
Model: Macbook Pro
AppleScript: Version 2.3 (118)
Browser: Firefox 9.0.1
Operating System: Mac OS X (10.6)