The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   awk, cut, and sed (http://hintsforums.macworld.com/showthread.php?t=105862)

tw 10-27-2009 11:16 AM

Quote:

Originally Posted by tlarkin (Post 559062)
I know how to do all of this from the command line, I have no clue how to tie it to buttons on a little interface and have it write to the files it installs to configure the launchd and script settings.

are you using 10.5 or 10.6? in 10.5 (as acme suggests) you can use applescript studio and interface builder, and it's actually very easy to do something like this. open xcode and start a new applescript application project. double-click on the .xib file (which opens a default interface in interface builder) and build the GUI by adding stock buttons, text fields, and etc. then you click on each button. open the inspector window and then click on each element in turn - the last panel in the inspector window lets you attach the the element to your script, set the name of the element, and select any actions you want to code (like 'click'). once that's all set to your liking, go back to xcode and add your code - IB will have made (for instance) an 'on click' handler, so add a bunch of if statements to check (say) the name of the button that got clicked (all button clicks will go to the same 'on click' handler), and run the appropriate shell command using do shell script. well, setting the time interval will be a bit trickier, because you'll need to use system events to modify the launch daemon plist file and then unload and reload it...

tlarkin 10-27-2009 11:28 AM

Quote:

Originally Posted by tw (Post 559073)
are you using 10.5 or 10.6? in 10.5 (as acme suggests) you can use applescript studio and interface builder, and it's actually very easy to do something like this. open xcode and start a new applescript application project. double-click on the .xib file (which opens a default interface in interface builder) and build the GUI by adding stock buttons, text fields, and etc. then you click on each button. open the inspector window and then click on each element in turn - the last panel in the inspector window lets you attach the the element to your script, set the name of the element, and select any actions you want to code (like 'click'). once that's all set to your liking, go back to xcode and add your code - IB will have made (for instance) an 'on click' handler, so add a bunch of if statements to check (say) the name of the button that got clicked (all button clicks will go to the same 'on click' handler), and run the appropriate shell command using do shell script. well, setting the time interval will be a bit trickier, because you'll need to use system events to modify the launch daemon plist file and then unload and reload it...

All 10.5 as I am resisting upgrading to 10.6. I haven't ever really messed with that stuff but I can write in shell and I know a bit of Apple Script.


All times are GMT -5. The time now is 10:17 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.