making text scroll (like in iTunes) when text is longer than textfield

ok, so in my iTunes controller, i have text that shows the current track info (title, artist,album) but since my app is made to be small i couldn’t make the text fields very big. Is there anyway so that it scrolls sideways just like in iTunes, if the text is longer than the defined field? For the life of me I can’t figure it out.

i am assuming by the lack of replies that it is impossible am I correct?

Nothing is impossible. There is no “scroll text” command or any simple solution, but it is certainly possible.

You could go with a javascript-like scroller, which parses a text string and displays only a portion of the larger string at an incrementing offset… giving a crude scrolling effect. You could also use some mask images on either side of the text field, and manually move the whole text field from side to side, to achieve a scrolling effect. Unfortunately, there are two major obstacles to performing these brute-force kind of techniques. 1, applescript is pretty limited to 1 second intervals. This is hardly a reasonable rate for creating effective and attractive scrolling effects. 2, AS does not allow for you to multithread, making the AS repeat loop necessary to achieve the effect the only task that can be running while the text would be scrolling. Doing things in this way is really just a hack, though, and would be kludgy and most likely quite ugly.

Ideally, you should write some pretty complicated code in obj-c that would actually manipulate the text field’s cell and truly scroll the content displayed… which is what apple is likely doing. AS will probably never offer you the power you need to effectively do this. Perhaps you should consider picking up some cocoa, or you could re-think your interface. Otherwise, maybe you should just consider it impossible. :wink:


gah, i can’t learn obj-c or cocoa…it’s too abstract…i tried…but just too abstract…which is what i like about As…very human language…so its official…i’m not gonna try anymore:P

Hey hendo13,

Here’s a Cocoa solution:
CocoaDev: ScrollingText

apparently that one crashes and its sloppy