====== About the script ====== * Purpose : The script ideally takes the last used app (that is not the launcher) and change the item to be as the app shortcut of that app. * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/AYw6vBACbw4 (with video) ====== How to use the script ====== Instructions: set it in the resumed event of an item (use a new shortcut, intent/icon/label will be overwritten) It will take the default icon, no icon packs. It can be buggy sometimes (I didn't tested it a lot too), and maybe it throws an error, but I hope not to. The code is a bit messy, and I'm sure it can be improved. It can be modified to show more than one of the recent apps, but it is not implemented. Feel free to do so. ====== Script code ====== var MAX=10; var FORCEALL=false; LL.bindClass("android.app.Activity"); var am = LL.getContext().getSystemService(Activity.ACTIVITY_SERVICE); var list = am.getRecentTasks(MAX,FORCEALL?1:0); var names=""; var last=""; var cmp=""; for(var i=0;i