レイヤーを複数選択して実行すると、一番最初に選んだレイヤーの長さにトリムされます。
Select multiple layers and run this script. Then selected layers will be trimmed to the length of the first layer selected.