Create a .bat type file for OS X

Joined
Sep 10, 2007
Messages
1
Reaction score
0
Points
1
Hi all, I'm new to this forum, so please forgive any overlooked formalities or traditions.

I am trying to find a way to create a .bat type of file for mac OS X. For those of you who dont know; a .bat file is file for pc's. It is a file that executes two or more commands when opened. For instance, one might want to clear their cache as they open a web broweser. You would create a .bat file (which is created in a text editor and executes dos commands) this file would clear your cache and then open your browser all in the background. You could then replace the default .bat icon with that of your favorite web browser and no one would be the wiser.

Specifically what I am trying to achieve is as follows; I would like to have a sound played when I open an application. That is, a specific sound for specific applications. If anyone knows of another way to achieve this, I am all ears.

Thanks for your time.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
You should be able to create an AppleScript to do what you want.
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
rman, I am guessing you are suggesting writing an Applescript that plays the sound and then launches the app? dbUSMC would then launch the Applescript, not the original app, to get the sound/app behavior he is looking for?

I am no Applescript expert (or even novice for that matter). How does one play a sound file via an Applescript command?

dbUSMC, I am guessing you are coming to Mac from a KDE based Linux environment? I *love* the KDE sound splashes on various window manager events. It is the one thing I haven't been able to reproduce from Linux on my Mac. Good luck on this one.
 
Joined
Aug 4, 2007
Messages
303
Reaction score
8
Points
18
Your Mac's Specs
MacOS Sonoma
Try the 'Automator' tool to develop AppleScript scripts which uses a GUI where you specify the application, action and objects to use.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top