F-Script Anywhere Universal!

Today has been a week of much coding — a new release of Active Timer will be out soon (more on that later) and I’ve just finished the work getting F-Script Anywhere to work on Intel. For those of you asking, the code I am working on is from Nicholas Riley’s top of tree. It looks like I’ll be taking over maintenance of FSA for the time being, and as such Nick will be giving me access to his repository so I can commit my changes in. This is a good thing, as the source right now for the various versions exists in different directories across my G5 and MacBook. Both PPC and Intel versions of FSA are powered by mach_inject (the mach inject work for FSA was primarily done by Nick), and with the recent work (well, somewhat recent) by Bertrand Guiheneuf on mach_inject for intel, I was able to get a version of FSA working fairly easily. Note that on intel you will have to follow the instructions on how to enable cross-task control. So without further ado I bring to you F-Script Anywhere Universal.

Some slight notes for this version as far as the specific work that was required. I’m not sure if this will be of any use to anyone, but it will allow me to document what I’ve done somewhere. Currently this binary is stitched together using lipo and built on two separate machines, since it requires some darwin source to be built for various reasons. Additionally the binary currently doesn’t work on intel when built with debug symbols, I imagine this has something to do with how much space the code takes up, but I’m not sure and I didn’t bother to find out. Also lipo failed me with the internal SCPatchLoader bundle, since a lipo’d binary would end up resulting in a vm_allocate error when running on ppc (although it would run fine on intel). I really have no idea what could cause this to happen (maybe some sort of alignment error? I don’t know), but it sounds like it probably should be some sort of lipo bug maybe. So I ended up working around this by including two bundles, a ppc and an intel bundle that gets dynamically loaded depending on the machine you’re on. Anyone who wants a copy of the source should send me an e-mail, and I can hook you up.

As far as Active Timer goes, I’ve been working on a much improved version that allows you to track the time spent in each window as well as each application. I’ve also implemented some more precise timing functionality and the ability to automatically transfer idle time to the idle category when the app detects that you have been idle. Hopefully this will be the first in a series of updates for Active Timer that will make it even better than it is currently. I’m hoping to release this version sometime in the coming week, assuming no large bugs show up. For all of those who want to test out a beta version, leave a comment.

10 Responses to “F-Script Anywhere Universal!”

  1. RobertChin Says:

    For those who want the updated FSA source (and to comply with the terms of the GPL) you can now get a copy of FSA-Universal-Source.zip. If this link no longer works, it means that the source has been checked into Nicholas Riley’s source tree. Note that you will need to get a copy of cctools source from Apple and do some tweaking of their source in order to get FSA to compile.

  2. Jack Bransfield Says:

    I just happened across your blog today, and I’m happy to hear that you’ve been working on Active Timer. I’d love to test out a beta version.

    Thanks,
    Jack

  3. Red Sweater Links » Blog Archive » F-Script Anywhere on Intel! Says:

    [...] Robert Chin has taken Nicholas Riley’s sources and updated them to both work with the latest F-Script and also run on Intel-based Macs. Source is linked to from the comments. Thanks, Robert! Link. [...]

  4. Mithras Says:

    Sorry to be a dope, but how should I go about tickling F-Script itself to compile as universal? Merely adding ‘intel’ to the build settings of the targets doesn’t seem to do it…

  5. Mithras Says:

    Nevermind, figured that out. I was indeed being a dope.
    Unfortunately, after having compiled the framework as Universal, using FSA reliably crashes Cocoa apps I try to apply it to. e.g.

    Thread 1 Crashed:
    0 libSystem.B.dylib 0x90001a00 pthread_self + 0
    1 libSystem.B.dylib 0x9002b438 fputc + 40
    2 > 0x14d11db1 0 + 349248945

    Thread 1 crashed with i386 Thread State:
    eax: 0xa0001ff0 ebx: 0x9002b41e ecx:0×00000000 edx: 0×00000001
    edi: 0xa0001c70 esi: 0xa0001c70 ebp:0x14c0af58 esp: 0x14c0af3c
    ss: 0x0000002f efl: 0×00010202 eip:0x90001a00 cs: 0×00000027
    ds: 0x0000002f es: 0x0000002f fs:0×00000000 gs: 0×00000000

  6. Tom in Cala Dor Palma de Mallorca Says:

    I just happened across your blog today, and I’m happy to hear that you’ve been working on Active Timer. I’d love to test out a beta version.

  7. Robert Chin Says:

    Mithras: try compiling your application as a release build. There are some unresolved problems with how gcc lays out the code with the debug build. Sorry about not getting back to you earlier.

  8. Squeak, Smalltalk and OOP » Saving QuickTime movies from the web with F-Script Says:

    [...] Start F-Script Anywhere and inject F-Script into the web browser. [...]

  9. Squeak, Smalltalk and OOP » F-Script Anywhere Universal Says:

    [...] This new version of F-Script Anywhere can inject the F-Script environment in any running Cocoa-based application without using SIMBL or PyInjector. [...]

  10. plastik Says:

    F-Script is an integrated set of tools that makes it possible to interactively explore and manipulate Cocoa objects as well as script them using new high-level programming techniques. This article shows you how to use some of its most impressive features and demonstrates how it can be a useful addition to your developer toolkit.

Leave a Reply