# set Preview Range to selected Action automatically

Is there a way to automatically set the animation preview range to the selected action whenever the selected action has changed.

I am editing different looping animations on a characer. Every animation is an action. When I change the action I need to reset the preview range of the animation playback by pressing Ctrl + Alt + P to be able to preveiw the loop. Is there a way to automate this, such that the preview frame range is changed according to the newly selected Action?

Also, my looping Actions usually start and end with an identical keyframe. To get a perfectly looping preview it's nice to exclude either the first or last Keyframe from the loop. Is there a way to automatically set the preview range so it includes only the starting keyframe, and runs upto the the frame just before the last keyframe?