|
|
#1 |
|
How to make a app to execute terminal command
I want to make a app that executes a terminal command with a button. Eg when I press the button I want it to purge the memory how do i do that? HELP!
|
|
|
|
0
|
|
|
#2 |
|
|
0
|
|
|
#3 | |
|
Quote:
|
||
|
|
0
|
|
|
#4 | |
|
Quote:
Code:
do shell script "purge" ---------- The same way you'd do it in any other AppleScript. If you're looking for a tutorial on writing AppleScript and hooking it up to buttons, you should search for that using a search engine like google. If all you want to do is run the 'purge' command, you don't need a button for that. Enter the command I posted above. Save your AppleScript as an application. To purge memory, launch the application. Every time the application is launched, it purges memory. No button needed/ If you want to do other things, like present a dialog, there are AppleScript commands for that. Google search terms: applescript dialog. If you want a complete window, with multiple buttons, one of which purges memory, and other buttons that do other things, look for a tutorial on making windowed applications with buttons in AppleScript. Everything other than do shell script "purge" will be common to all such AppleScript apps. |
||
|
|
2
|
|
|
#5 | |
|
Quote:
|
||
|
|
0
|
|
|
#6 | |
|
Quote:
Are you asking how to get memory usage statistics? Or are you asking how to display statistics in a list that looks similar to Activity Monitor? Are you really trying to write a replacement for Activity Monitor using AppleScript? If so, why? |
||
|
|
0
|
|
|
#7 | |
|
Quote:
|
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 08:09 AM.







Linear Mode
