Hi there, i’m new here, and hoping someone can help with this
Please dont ask why i’m trying to do it, it’s just for a mini project
I’m trying to write a script that will execute the command:
df -kl /
and read the 7 characters after “/dev” and add them into a text file at a particular point located by the bold text as shown below
The big criteria here is that at no point is the terminal application to be opened, because if that was part of it, a simple copy and paste instruction would make it easy. I’m trying to do this for those that dont want to have anything to do with the terminal but still have access to its strengths
My first problem is how to get the code to run as an application because at the moment as it is
do shell script "df -kl /"
It runs direct from applescript but if i save as application it just runs and does nothing, whereas if i run from applescript it displays in a window. Before i get into the searching of the result i want to make sure that it runs as an app.
I am not very good with applescript and could also do with some pointers in writing whatever is the best search and extract command, whether it be find/grep/awk or some kind of perl script. Also based on what applescript can achieve so that i can figure out the best way to do it.
Particularly interested in whether it’s best to add the text file data to the applescript with a variable and create the text file from that rather than add the variable into an already created text file. Like i say, i’m not too hot on my scripting, and any help/suggestions would be much appreciated
Many Thanks in Advance