>>621
下記のような Profile をアプリごとに作成して,起動中のアプリをグローバル変数(ここでは %ForegroundApp)に保存しておく.
Profile: A (161)
Application: A
Enter: Anon (215)
A1: Variable Set [ Name:%ForegroundApp To:A Recurse Variables:Off Do Maths:Off Append:Off ]

Exit: Anon (216)
A1: Variable Clear [ Name:%ForegroundApp Pattern Matching:Off ]

次に,エンジンオフで下記の Action を実行して,最後に起動していたアプリを別のグローバル変数(ここでは %ResumeApp)に保存するようにする.
A1: If [ %ForegroundApp Set ]
A2: Variable Set [ Name:%ResumeApp To:%ForegroundApp Recurse Variables:Off Do Maths:Off Append:Off ]
A3: Else
A4: Variable Clear [ Name:%ResumeApp Pattern Matching:Off ]
A5: End If
この後,%ResumeApp の値を見て,条件分岐させて,停止処理もやる.

同様に,エンジンオンの Task では,保存しておいたグローバル変数(%ResumeApp)の値を見て,条件分岐させればよい.