Set GetInfo "Open in 32-bit mode" flag using AppleScript?

For debugging reasons, I have an application package (consisting of three different applications), all of which can run in either 32-bit or 64-bit mode in 10.6. However, they all need to run in the same mode, whether 32- or 64-bit. Right now, I have to GetInfo each one from the finder and turn the “Open in 32-bit mode” flag on or off manually each time I want to switch the overall mode the apps use.

Sounds like an obvious case where a simple script should be able to do the work for me, and save me the endless GetInfo’ing of all three apps, right? Not quite.

I’ve checked documentation at ADC, various scripting websites, etc. and nowhere can I find how to access the “Open in 32-bit mode” property of an application within AppleScript. It isn’t even listed in the Finder dictionary as far as I can tell, though it could easily be hiding somewhere in there.

Does anyone know whether AppleScript can direct Finder to change the “Open in 32-bit mode” flag on a given application file? If so, how is that property accessed?

Thanks in advance!

Someone here I bet knows a shell script, but you might possibly also GUI script, start here maybe: http://www.macosxautomation.com/applescript/uiscripting/index.html and look at the processes suite in the System Events library. Wait to see if someone has a shell script though.

Well, as a shell script, the closest I’ve found is the “arch” command, but that provides launch-time selection not a persistent change to the app itself. The manpage makes reference to a way to create .plist files that tell which architecture to use, and tells users to look at /System/Library/archSettings for examples of the format. Unfortunately, 10.6 appears to have no such directory, perhaps removed at some point after the manpage but before release.

As most of the other GetInfo properties are accessible as part of the application file object, that’s where I expected this as well, but couldn’t find anything in the Finder dictionary that looked remotely similar. It may well be another case where the AS or Finder guys just haven’t quite caught up with the rest of the OS, but I hope not.

So I looked at doing it with UI scripting (thanks to Prefab’s UI Browser), but the main problem I encountered there was that I’d need to manually script Finder to open GetInfo windows for all three apps, which seems like a nasty amount of work using UI scripting starting from an arbitrarily-set Finder window. I can’t find an easy way to get Finder to open a GetInfo window on an arbitrary file path using applescript either, and doing it via manual UI navigation also makes the script very difficult to genericize for others to use (a secondary goal, but still a consideration).

I’m kind of surprised Apple didn’t realize the “open in 32-bit mode” switch would be a prime candidate for automation, which makes me think perhaps they expected us to handle this differently – perhaps using aliases somehow?