Kator Legaz Kator Legaz
Arcade Cabinets


AppleScript for MacMAME-to-MAME OS X Screenshot Conversion

We have been fans of MacMAME for many years, but development for that particular arcade emulator ceased in 2006. The last version of MacMAME was 0.103u2 and the MAME project is currently at 0.119. While that is not a problem within itself, the last version of MacMAME is a PowerPC application and not optimized for Intel processors. The older MacMAME still runs on our Intel Macs, although it performs less reliably than on older Macs with PowerPC processors.

MAME OS X is a newer port that takes advantage of more OS X technologies, and because it is a universal application it runs well on both PowerPC and Intel Macs. There are noticeable performance improvements on our Intel Macs and better game compatibility than when running MacMAME.

We are impressed with MAME OS X, but were disappointed to find that all of our old screenshots from MacMAME weren't in the right format. MacMAME stored screenshots as PNG files named after the arcade ROM. MAME OS X places screenshots into a folder named after the arcade ROM, and will not recognize files if they are not in the appropriate folder. For example, in MacMAME the Pac-Man screenshot was titled "pacman.png." In MAME OS X, the screenshot is located in a folder titled "pacman."

Existing screenshots must be moved and placed into correctly named folders. If you only have a dozen screenshots, that isn't such a big deal. We had thousands, which just wasn't reasonable to do manually. To automate the conversion, here is an AppleScript anyone can use to convert things properly.

1. Copy your old "Screenshots" folder from MAME or MacMAME to your desktop.

2. Copy this script:

set desktop_folder to the path to the desktop folder
set source_folder to desktop_folder & "Screenshots" as string

tell application "Finder"
make new folder at desktop_folder with properties {name:"FORMATTED Screenshots"}
end tell

set dest_folder to "Macintosh HD:Users:katorlegaz:Desktop:FORMATTED Screenshots" as string
set the item_list to list folder source_folder without invisibles

repeat with i from 1 to number of items in the item_list

set this_item to item i of the item_list
set old_name to this_item as string
set the new_name to (characters 1 thru -5 of this_item) as string

tell application "Finder"
make new folder at dest_folder with properties {name:new_name}
end tell

set move_folder to dest_folder & ":" & new_name as string

tell application "Finder"
duplicate file old_name of folder source_folder to folder move_folder with replacing
end tell

end repeat

3. Launch the AppleScript Script Editor in the Applications/AppleScript folder.

4. Paste the copied code into the script window.

5. Click on "RUN." Depending on the number of files, this may take a while. 3,000 screenshots took about 7 minutes to finish on an Intel iMac.

6. There should now be a new folder named "FORMATTED Screenshots" on your desktop. It should have the exact same number of items as the original "Screenshots" folder.

7. Copy the contents of the "FORMATTED Screenshots" folder to your user library, specifically Library/Application Support/MAME OS X/Screenshots.

The next time you run MAME OS X, even without a front-end, the screenshots should display when you select a ROM.

Google      
    Kator Legaz    Web   

Contents Copyright © 2003-2008 Andrew Kator & Jennifer Legaz. All Rights Reserved.
Contact us with questions or feedback.