code

AppleScript to Generate Strong Passwords

I’d totally forgotten about this resource until I needed to create a strong password this morning.

Continue reading →

A Better AppleScript to Compress Files or Folders

A while ago, I created an AppleScript that allows you to compress files and folders by simply dropping them onto the applet. One of the readers left a comment asking for a way to achieve the following tasks:

  1. Select a folder from Finder.
  2. Store the folder name as “x”.
  3. Compress all files and sub-folders within the folder “x”, including their paths.
  4. Rename the resulting zip file as “x.zip”.
  5. Delete all the files that were used to create the zip file.

With the help of ChatGPT – and because I wanted to be lazy about it – I was able to come up with a solution to this challenge, which can be a great way to manage archives if that’s important to you.

Continue reading →

AppleScript to Compress Files and Folders

I had the need to select several folders at once in the Mac OS Finder and zip them up as individual archives. This AppleScript to compress files and folders was the solution I came up with.

Continue reading →

Salesforce Flows, Visualforce and Context

I was asked to find a solution for our field reps that would simplify the process of adding a completed task to their activities when they visited one of our retail stores. We keep our retail locations in Salesforce.com as contacts under a master account, which is shared with all users using a special account sharing rule. The solution I came up with was a simple flow that limited users to a specific set of enterable information, pre-filling the date of the activity, and marking the task complete when the activity was committed.

Continue reading →

Making a Field Appear Required on a Visualforce Page

I’ve been working on a force.com app with the requirement that a user must enter a valid email address on a Visualforce page before being able to save a record. But they must also be able to insert the related contact’s email address by clicking a button instead of having to leave the edit page to go find it. That seemed simple enough, but it wasn’t. This is my solution for making a field appear required on a Visualforce page.

Continue reading →

AppleScript to Add Files in the Mac Finder

Today I had the need to add a bunch of named text files to a folder in the Finder on my Mac.

Continue reading →

AppleScript to Toggle the Mac Desktop

Here’s an AppleScript I use to quickly toggle desktop visibility for taking screenshots and recording screencasts that I thought might be useful for others.

Continue reading →