Most code in slides is a screenshot. It looks fine and it cannot move: you show the finished thing, or you show three pictures in a row and hope people track the difference themselves.
Keynote can do better than that. Magic Move interpolates between two slides, and if the code is real text rather than an image, it will animate the individual words — a line sliding down to make room, a value changing, a whole block appearing while everything around it shifts to accommodate it.
That is two slides and one transition. No After Effects, no video track.
Why a screenshot cannot do this
Magic Move works by matching objects on two consecutive slides and animating between them. A picture is one object. Keynote can move it, scale it, fade it — but it cannot reach inside and animate the fourth line, because as far as Keynote is concerned there is no fourth line.
Text is different. A text box holds words, and Magic Move can match them individually.
So the whole technique depends on getting coloured code as text into Keynote. Typing it and colouring it by hand is miserable. Pasting from your editor loses the highlighting, because editors put plain text on the clipboard.
Getting coloured code out as text
Codeshot exports two things. PNG is the composed picture — backdrop, window chrome, shadow. RTF is the code alone as coloured text.
Set Format to RTF and press Copy RTF. There is no backdrop in the RTF and that is deliberate — the slide supplies its own background, and a second one behind the text would only get in the way.
One detail worth knowing, because it is the thing that usually ruins pasted code: RTF identifies fonts by name, and the system monospaced face has a private name that other apps cannot resolve. When they fail to resolve it they substitute something proportional, and the column alignment that makes code read as code collapses. Codeshot swaps in Menlo on the way out so this does not happen. If you picked a font yourself, that name is public already and goes through untouched.
Building the two slides
Paste into a slide. Command-V. The colours come with it. Resize the text box, but do not retype anything — Magic Move matches on the words themselves.
Duplicate the slide. In the navigator, select it and press Command-D. You now have two identical slides.
Edit one of them. Either add to the second slide the lines that were not there yet, or — often easier — paste the finished snippet and delete lines from the first slide until it shows the earlier state. Everything you leave alone is what Magic Move will animate; everything you add or remove is what it will fade in or out.
Working backwards is worth preferring. Magic Move matches on the words themselves, so lines that should stay put have to be identical on both slides. Deleting from a duplicate guarantees that; retyping a line by hand is how you end up with a word that quietly fails to match and jumps instead of moving.
The order matters: the transition belongs to the slide you are leaving, so build the before state first.
The one setting that makes it work
Select the first slide, open the Animate inspector, and add Magic Move.
Then change Match from its default to By Word.
This is the setting the whole effect hangs on. Left alone, Magic Move treats the text box as a single object and cross-fades it — you get a blur between two states rather than code that moves. By Word tells it to match the words on each slide and animate them individually, which is what makes lines slide and values change in place.
Duration around 1.5 to 2 seconds reads well for code. Faster and people cannot follow which line moved, which is the entire point of doing this.
Fade Unmatched Objects should stay on. That is what makes new lines appear and removed lines disappear rather than popping.
Making a sequence
Three slides, two Magic Moves, and you can walk an audience through a refactor one step at a time: the naive version, the extracted function, the final form. Each transition carries the unchanged lines across so the eye stays anchored on what actually changed.
Keep each step small. Two or three lines of difference per transition is plenty — a slide that changes half its content animates into noise.
When to use a picture instead
Not every code slide wants this.
If the code never changes, a PNG is simpler, sharper, and carries the window chrome and backdrop that make it look designed. Export at 2× and be done. The full workflow covers that path.
Use RTF and Magic Move when the change is the point — when you are showing a diff, building something up, or explaining why one version became another.
Beyond Keynote
The same RTF goes into Pages, Word, and anything else that takes rich text. It is coloured, selectable, searchable text rather than a picture — which also means it stays readable to a screen reader, and someone can copy a line out of your document and run it.