Open an .html file with default browser using Bash on Mac

So, this is what I need : Let’s say I have an index.html file. How do I tell the terminal to open it using the default browser? (Using AppleScript, BASH,…?) Answer from the directory containing index.html, try… open ./index.html the open command opens a file (or directory, or URL). open is included with MacOSx. specifics … Read more

How do I make a Mac Terminal pop-up/alert? Applescript?

I want to be able to have my program display an alert, notice, whatever that displays my custom text. How is this done? Also, is it possible to make one with several buttons that sets a variable? Similar to batch’s: echo msgbox””<a.vbs&a.vbs Answer Use osascript. For example: osascript -e ‘tell app “Finder” to display dialog … Read more

Writing FizzBuzz like this makes me feel like a small child

For the sake of full disclosure, this was written with bananas, not apples. The doctor may not be kept away. With AppleScript highlighting: For Copy&Pasting: activate application “TextEdit” tell application “System Events” repeat until first window of application “TextEdit” exists tell application “TextEdit” to make new document at the front delay 1.0E-3 end repeat repeat … Read more