osx

Mac SVN - How to install a Subversion (SVN) server on Mac OS X

Mac SVN FAQ: How do I install Subversion (SVN) on a Mac OS X system?

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

How to run an AppleScript from the Mac OS X Unix shell

AppleScript FAQ: How can I run an AppleScript script from the Mac Unix terminal (Unix command line)?

A cool thing about Mac OS X is that you can run AppleScript programs from the Unix shell. (Well, I guess it's cool if you're a Unix user.)

Running an AppleScript program from the Unix shell turns out to be surprising easy. For instance, if my current working directory has a script named OpenUrls.scpt in it, I can run that script from the command line like this:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

How to customize AppleScript dialogs (dialog boxes)

AppleScript FAQ: How can I customize AppleScript dialog boxes?

When you display an AppleScript dialog box with the display dialog code, you don't have to just use the standard Cancel and OK buttons, you can change the text to something more meaningful to your specific prompt. For instance, suppose you want to ask someone their age range:

display dialog "How old are you?" buttons {"Less than 1", "Older than 1"}

(Okay, not the greatest example in the world, but that's all I've got today.)

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

AppleScript repeat while examples

AppleScript while loop FAQ: Can you share some examples of the AppleScript while loop syntax (the AppleScript repeat while syntax)?

Instead of using a keyword like "while" to create loops, AppleScript uses the "repeat" keyword to create loops. There are several versions of this syntax, as follows.

AppleScript repeat syntax: Repeat X times

Here's how to repeat an AppleScript command X number of times:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

AppleScript: How to display a number in a dialog

To display a number in a dialog using AppleScript, just treat it like a string and you'll be fine. Here's a direct example:

display dialog 4.79

And here's an example using a variable:

set myNum to 4.88
display dialog myNum

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

macOS AppleScript example: Display clipboard contents in a dialog

AppleScript clipboard FAQ: Can you demonstrate an AppleScript clipboard example, such as displaying the Mac OS X clipboard contents in an AppleScript dialog?

One of the crazy things about AppleScript is how easy it is to get the contents of the clipboard, and then display them in a dialog. Here's an AppleScript clipboard dialog example that does just that:

display dialog (the clipboard)

Yep, that's it, just one line of text. Put this AppleScript code in your own ScriptEditor and run it, and you'll see it display the clipboard contents.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

An AppleScript dialog textfield example

AppleScript dialog FAQ: How can I display an AppleScript dialog with a textfield (text field)?

A frequent AppleScript question is "How do I prompt a user to enter some text?" Here's how you display an AppleScript dialog to prompt a user to enter a simple piece of information, in this case their name:

display dialog "What is your name?" default answer ""

Running this AppleScript dialog code results in the following dialog:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

Apple events and the AE Monitor

I haven't used it yet, but AE Monitor looks like it might be a good tool to see the Apple Events that are firing on your Mac OS X system. As I get more into Mac-specific programming (using Cocoa, Xcode, and AppleScript) I just wanted to make a note to remember this.

 

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

Mac Activity Monitor - Mac process and memory usage

The Mac OS X Activity Monitor is a cool utility. As shown in the following figure, the main screen shows all the processes running on your system, the user that owns the process, the percent of CPU it's using, the virtual memory it's using, and more. My most common thing here is to sort by memory or CPU use to get a general idea of what's going on.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

Run a picture slideshow from the Finder

One of the cool things I just discovered on my Mac is the slideshow capability of the Finder. This can be a great tool for previewing a collection of images, or just to rotate images on your screen just for fun. Just highlight a few images, right-click, and choose the Slideshow option.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.