Advertisement
Guest User

Tasker Scene Manager Task/ tool

a guest
Apr 27th, 2022
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.40 KB | None | 0 0
  1. Task: Tasker Scene Manager
  2.  
  3. <✅ <font color="#00884E"><b> COLOR FOR VISIBLE SCENE NAMES IN LIST>
  4. A1: Variable Set [
  5. Name: %visible_text_color
  6. To: #005F07
  7. Max Rounding Digits: 3 ]
  8.  
  9. <✅ <font color="red"><b>COLOR FOR HIDDEN SCENE NAMES IN LIST>
  10. A2: Variable Set [
  11. Name: %hidden_text_color
  12. To: #B10000
  13. Max Rounding Digits: 3 ]
  14.  
  15. <<h3>↘ <b><font color="#000000"> BEGIN>
  16. A3: Anchor
  17.  
  18. A4: Flash [
  19. Text: PLEASE WAIT, CREATING LIST...
  20. Tasker Layout: On
  21. Background Colour: #FF000000
  22. Continue Task Immediately: On
  23. Dismiss On Click: On ]
  24.  
  25. <<font color="blue"><b> GET ALL SCENES IN TASKER>
  26. A5: Test Tasker [
  27. Type: Scenes
  28. Store Result In: %all_scene_names ]
  29.  
  30. <SORT ALPHABETICALLY>
  31. A6: Array Process [
  32. Variable Array: %all_scene_names
  33. Type: Sort Alpha Caseless ]
  34.  
  35. <RESET COUNTER>
  36. A7: Variable Set [
  37. Name: %counter
  38. To: 0
  39. Max Rounding Digits: 3 ]
  40.  
  41. <<font color="blue"><b> LOOP THRU ALL TASKER SCENES>
  42. A8: For [
  43. Variable: %scene_name
  44. Items: %all_scene_names() ]
  45.  
  46. <TEST THIS SCENES STATUS>
  47. A9: Test Scene [
  48. Name: %scene_name
  49. Test: Status
  50. Store Result In: %status
  51. Continue Task After Error:On ]
  52.  
  53. <IF SCENE ISN'T CREATED AT ALL>
  54. A10: Goto [
  55. Type: Top of Loop ]
  56. If [ %status ~ uncreated ]
  57.  
  58. <ADD SCENE NAME TO VISIBLE ARRAY LIST, WITH HTML FORMATTING>
  59. A11: Array Push [
  60. Variable Array: %visible_scene_names
  61. Position: 9999
  62. Value: <font color="%visible_text_color"><b>%scene_name ]
  63. If [ %status ~ visible ]
  64.  
  65. <ADD SCENE NAME TO HIDDEN ARRAY LIST, WITH HTML FORMATTING>
  66. A12: Array Push [
  67. Variable Array: %hidden_scene_names
  68. Position: 9999
  69. Value: <font color="%hidden_text_color"><b>%scene_name ]
  70. If [ %status ~ hidden/background ]
  71.  
  72. <COUNTER + 1>
  73. A13: Variable Set [
  74. Name: %counter
  75. To: %counter+1
  76. Do Maths: On
  77. Max Rounding Digits: 3 ]
  78.  
  79. A14: End For
  80.  
  81. <IF NO SCENES AT ALL ARE SHOWING OR CREATED>
  82. A15: If [ %counter = 0 ]
  83.  
  84. A16: Flash [
  85. Text: NO SCENES VISIBLE OR HIDDEN
  86. Long: On
  87. Tasker Layout: On
  88. Background Colour: #FF000000
  89. Continue Task Immediately: On
  90. Dismiss On Click: On ]
  91.  
  92. A17: Stop [ ]
  93.  
  94. A18: End If
  95.  
  96. <COMBINE SCENE NAMES INTO FULL LIST>
  97. A19: Array Set [
  98. Variable Array: %combined_scene_list
  99. Values: %visible_scene_names(+◇₩)◇₩%hidden_scene_names(+◇₩)
  100. Splitter: ◇₩ ]
  101. If [ %visible_scene_names(#) > 0 & %hidden_scene_names(#) > 0 ]
  102.  
  103. <ONLY VISIBLE SCENE NAMES EXIST>
  104. A20: Array Set [
  105. Variable Array: %combined_scene_list
  106. Values: %visible_scene_names(+◇₩)
  107. Splitter: ◇₩ ]
  108. If [ %visible_scene_names(#) > 0 & %hidden_scene_names(#) = 0 ]
  109.  
  110. <ONLY HIDDEN SCENE NAMES EXIST>
  111. A21: Array Set [
  112. Variable Array: %combined_scene_list
  113. Values: %hidden_scene_names(+◇₩)
  114. Splitter: ◇₩ ]
  115. If [ %visible_scene_names(#) = 0 & %hidden_scene_names(#) > 0 ]
  116.  
  117. <<font color="blue"><b> SHOW MAIN SCENE LIST MENU>
  118. A22: List Dialog [
  119. Mode: Multiple Choices
  120. Title: %counter EXISTING SCENES
  121. Items: %combined_scene_list
  122. Button 1: SHOW
  123. Button 2: HIDE
  124. Button 3: DESTROY
  125. Close After (Seconds): 120
  126. Use HTML: On
  127. First Visible Index: 0
  128. Continue Task After Error:On ]
  129.  
  130. <IF NO LIST ITEMS SELECTED>
  131. A23: If [ %ld_selected(#) = 0 ]
  132.  
  133. A24: Flash [
  134. Text: NO SCENES SELECTED
  135. Long: On
  136. Tasker Layout: On
  137. Background Colour: #FF000000
  138. Continue Task Immediately: On
  139. Dismiss On Click: On ]
  140.  
  141. A25: Stop [ ]
  142.  
  143. A26: End If
  144.  
  145. <RESET COUNTER>
  146. A27: Variable Set [
  147. Name: %counter
  148. To: 0
  149. Max Rounding Digits: 3 ]
  150.  
  151. <<font color="blue"> <b>PERFORM SELECTED ACTION ON EACH SCENE>
  152. A28: For [
  153. Variable: %scene_name
  154. Items: %ld_selected() ]
  155.  
  156. <<i>1REMOVE HTML FORMATTING>
  157. A29: Variable Search Replace [
  158. Variable: %scene_name
  159. Search: (\<)[^>]+(\>)
  160. Replace Matches: On ]
  161.  
  162. <TEST>
  163. A30: [X] Flash [
  164. Text: %scene_name
  165. Continue Task Immediately: On
  166. Dismiss On Click: On ]
  167.  
  168. A31: Show Scene [
  169. Name: %scene_name
  170. Display As: Overlay, Blocking
  171. Horizontal Position: 100
  172. Vertical Position: 100
  173. Animation: System
  174. Show Exit Button: On
  175. Show Over Keyguard: On
  176. Continue Task Immediately: On
  177. Overlay +: On
  178. Continue Task After Error:On ]
  179. If [ %ld_button ~ show ]
  180.  
  181. A32: Hide Scene [
  182. Name: %scene_name
  183. Animation: System
  184. Continue Task After Error:On ]
  185. If [ %ld_button ~ hide ]
  186.  
  187. A33: Destroy Scene [
  188. Name: %scene_name
  189. Continue Task After Error:On ]
  190. If [ %ld_button ~ destroy ]
  191.  
  192. <COUNTER + 1>
  193. A34: Variable Set [
  194. Name: %counter
  195. To: %counter+1
  196. Do Maths: On
  197. Max Rounding Digits: 3 ]
  198.  
  199. A35: End For
  200.  
  201. <<font color="blue"><b> CONFIRM ACTION PERFORMED ON SELECTED SCENES>
  202. A36: Flash [
  203. Text: ACTION: %ld_button
  204. APPLIED TO %counter SCENES
  205. Tasker Layout: On
  206. Title: COMPLETE!
  207. Background Colour: #FF000000
  208. Continue Task Immediately: On
  209. Dismiss On Click: On ]
  210.  
  211. <❌ <font color="#000000"><b>MAIN STOP>
  212. A37: Stop [ ]
  213.  
  214.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement