  We rigorously study the long time dynamics of solitary wave solutions of the
nonlinear Schr\"odinger equation in {\it time-dependent} external potentials.
To set the stage, we first establish the well-posedness of the Cauchy problem
for a generalized nonautonomous nonlinear Schr\"odinger equation. We then show
that in the {\it space-adiabatic} regime where the external potential varies
slowly in space compared to the size of the soliton, the dynamics of the center
of the soliton is described by Hamilton's equations, plus terms due to
radiation damping. We finally remark on two physical applications of our
analysis. The first is adiabatic transportation of solitons, and the second is
Mathieu instability of trapped solitons due to time-periodic perturbations.
