Archive for the ‘Uncategorized’ Category

June 26th, 2010  Posted at   Uncategorized
   |   1 Comment

As mentioned on my previous post, I began an effort to write some AppleScript to help me with some auto file naming on scanning I was doing. The general method I decided to employ was to build a Folder Action that would watch for new files to be added to the Desktop, and then if a file matching a certain obscure name existed, rename it automatically.

So I would make Image Capture write its output to a file called “scan_to_auto_rename.pdf” in the Desktop folder. The new folder action would see this file appear, then rename it to something like this: scan_yyyymmdd_hhmmss.pdf. In human that’s “scan_” plus the year, month, day, hours, minutes, and seconds.

To accomplish this, I had to write an AppleScript, drop it into /Library/Scripts/Folder Action Scripts/, then add the Folder Action via the UI. To add the action (assuming the script is written (correctly :) and located in the right place), go into Finder and right click the folder to which you want to add the action.

So I went to my home directory, right clicked on the Desktop folder, and selected “Folder Actions Setup…”. That popped up a dialog with a list of available scripts I could add. I scrolled down and found mine, aptly named “rename_scan_file.scpt”, selected it, and clicked Attach. That applied my script to the folder, and assuming my script was written correctly it would do something useful based on events taking place within/on that folder.

See next post for a look at the script itself.

January 20th, 2010  Posted at   Adobe Flex, Uncategorized
   |   No Comments

Forgive me if this is trivial and beginner (because it is :) ).

Here are two ways to get an image into a button.

First Method, using assets added to the project:
1. Open project properties, go to Flex Build Path, Source path tab, and click Add Folder…
2. Add the folder of images to your project
3. Reference an image in a button like this:
<mx:Button label=”Ok”
  icon=”@Embed(source=’accept.png’)” />
(A ton of great icons at Famfam)

Second Method, using absolute referenced assets:
1. Reference an image in a button like this:
<mx:Button label=”Ok”
  icon=”@Embed(source=’c:/assets/icons/famfam/accept.png’)” />
(Note the forward slashes)