View Full Version : Apple Script howto?
Hello,
while I have founda löot of ressources concerning Apple Script, I would like to know, what you would recommend to an absolute newcommer.
While I know how to write sh/bash scripts and know how to program in C , php and other languages I have no idea about Apple script. I would like ot learn it though, since I know, there could be a great bit of development going on, if I knew how to merge the unix scripting world with the apple scripting world.
Thank you
-d
mervTormel
07-13-2002, 03:21 PM
learn COBOL first :D
something like
$ SET SOURCEFORMAT"FREE"
IDENTIFICATION DIVISION.
PROGRAM-ID. ShortestProgram.
PROCEDURE DIVISION.
DisplayPrompt.
DISPLAY "I did it".
STOP RUN.
hehe, believe it or not, I grew up on VMS (VAX computer) and back then we often had to use COBOL, are they really alike, cobol and applescript ? ;)
-d
mervTormel
07-13-2002, 03:53 PM
hey, VMS!
i'm graduated phi beta goddam kappa from that school. ~20 year veteran, with one leg and a metal plate in my head. escaped from a COBOL hell hole in d'nang back in '82 when i got the MUMPS. our MIA's are still over there. they let a lot of 'em go TDY to fix the Y2K problems, but then they had to go back :D <ramble off>
poor digital, couldn't sell water to a Bedouin. <okay, ramble really off>
applescript is more wordy than cobol in some idioms. other than that, no, they are not alike. hmm, i would say applescript is like "if rosie o'donnel had william f. buckley's and william f. burroughs' love child and became a linguist..."
if you flesh out the "great bit of development" part, perhaps someone could suggest a direction for you. applescript+shell may be unsuited to your goal.
i can suggest that bourne shell and perl are good to know for any serious development elsewhere in unix.
Originally posted by mervTormel
i can suggest that bourne shell and perl are good to know for any serious development elsewhere in unix.
Yes, I agree. I know both pretty well, my problem is the following. I have a lot of useful scripts here on my powerbook, which do a lot of things on a shell level, that might be even interesting to apple users, if I could give those scripts some way to report back to the graphical interface. I was thinking about having them write temporrary files, which an apple script could pick up on. I do not know if there are perl cocoa bindings, such as perl TK bindings, that is why I thought, that it might make sense to learn Apple script, so I could merge the two worlds together, offering some graphical insight to those, which are uncomfortable using the shell.
-d
ok, I will be honest... I only code perl when I have to <g>
mervTormel
07-13-2002, 04:21 PM
okay, well, there are some callouts in applescript to run shell commands...
i'd search the forums for the likes of "do shell script" and you'll begin to see the marriage.
applescript always seemed, to me, to have a high overhead, but there may be a niche for some personal doo-dads that you speak of.
one, e.g., is to display the current partition sizes over 50% utilized. something like:
-- applescript ...
do shell script ¬
"df | awk '{if ( $5 >= 50 ) print $5,\" \",$6 }'"
-- somehow wrangle the results to display in the context of
-- the script
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.