Advertisement
Guest User

Untitled

a guest
Mar 20th, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1.  
  2.  
  3. Task: Test - TaskerCal
  4. Settings: Run Both Together
  5.  
  6. <Creating needed variables>
  7. A1: If [ 1 = 1 ]
  8.  
  9. A2: Multiple Variables Set [
  10. Names: %cal=Google:Vasking
  11. Values Splitter: =
  12. Structure Output (JSON, etc): On ]
  13.  
  14. A3: Variable Set [
  15. Name: %empty
  16. To:
  17. Structure Output (JSON, etc): On ]
  18.  
  19. A4: Variable Search Replace [
  20. Variable: %empty
  21. Search: [\s+\d+] ]
  22.  
  23. A5: Variable Set [
  24. Name: %empty2
  25. To: %empty
  26. Structure Output (JSON, etc): On ]
  27.  
  28. A6: End If
  29.  
  30. A7: Parse/Format DateTime [
  31. Input Type: Now (Current Date And Time)
  32. Output Format: HH:mm:ss
  33. Output Offset Type: None ]
  34.  
  35. A8: Variable Set [
  36. Name: %TestOutput
  37. To: ___
  38. %formatted : Initiating
  39. Events in list: %ctevents()
  40. Calendar: %ctcalendar
  41.  
  42. Append: On
  43. Structure Output (JSON, etc): On ]
  44.  
  45. A9: Popup [
  46. Text: Triggering
  47. Events in list: %ctevents()
  48. Calendar: %ctcalendar
  49. Layout: Popup
  50. Timeout (Seconds): 5
  51. Show Over Keyguard: On ]
  52.  
  53. A10: If [ %ctcalendar ~ *lkvanum* ]
  54.  
  55. A11: Multiple Variables Set [
  56. Names: %ce_account=%empty
  57. %ce_account_type=%empty
  58. %ce_calendar=%empty
  59. %ce_color=%empty
  60. %ce_description=%empty
  61. %ce_ent_time=%empty
  62. %ce_evt_id=%empty
  63. %ce_location=%empty
  64. %ce_owner_account=%empty
  65. %ce_start_time=%empty
  66. %ce_timezone=%empty
  67. %ce_title=%empty
  68. %ce_visible=%empty
  69. %ce_attendee_id()=%empty
  70. %ce_attendee_email()=%empty
  71. %ce_attendee_relationship()=%empty
  72. %ce_attendee_relationship_code()=%empty
  73. %ce_attendee_status()=%empty
  74. %ce_attendee_type()=%empty
  75. %ce_attendee_type_code()=%empty
  76. %ce_reminder_method()=%empty
  77. %ce_reminder_method_code()=%empty
  78. %ce_reminder_minutes_prior()=%empty
  79. %ce_reminder_id()=%empty
  80. %ce_all_day=false
  81. %ce_available=free
  82. %ce_guests_can_invite=true
  83. %ce_guests_can_modify=false
  84. %ce_guests_can_see_guests=true
  85. %ce_is_organizer=true
  86. Values Splitter: =
  87. Structure Output (JSON, etc): On ]
  88.  
  89. A12: For [
  90. Variable: %event_id
  91. Items: %ctevents()
  92. Structure Output (JSON, etc): On ]
  93. If [ %ctevents(#) > 0 ]
  94.  
  95. A13: Variable Set [
  96. Name: %TestOutput
  97. To:
  98. Step 1
  99. Getting event details for: %event_id
  100.  
  101. Append: On
  102. Structure Output (JSON, etc): On ]
  103.  
  104. <Getting information from existing>
  105. A14: If [ 2 Even ]
  106.  
  107. A15: Get Calendar Events [
  108. Event ID: %event_id
  109. Continue Task After Error:On ]
  110.  
  111. A16: Variable Set [
  112. Name: %tmp_err
  113. To: %err
  114. Structure Output (JSON, etc): On
  115. Continue Task After Error:On ]
  116.  
  117. A17: Get Calendar Attendees [
  118. Event ID: %event_id
  119. Continue Task After Error:On ]
  120.  
  121. A18: Variable Set [
  122. Name: %tmp_err
  123. To: %err
  124. Structure Output (JSON, etc): On
  125. Continue Task After Error:On ]
  126.  
  127. A19: Get Calendar Reminders [
  128. Event ID: %event_id
  129. Continue Task After Error:On ]
  130.  
  131. A20: Variable Set [
  132. Name: %tmp_err
  133. To: %err
  134. Structure Output (JSON, etc): On
  135. Continue Task After Error:On ]
  136.  
  137. <Error handling block>
  138. A21: If [ %tmp_err > 0 ]
  139.  
  140. A22: Variable Set [
  141. Name: %TestOutput
  142. To:
  143. Stopping after error!
  144. Error: %tmp_err
  145.  
  146. Append: On
  147. Structure Output (JSON, etc): On
  148. Continue Task After Error:On ]
  149.  
  150. A23: Popup [
  151. Title: Error caught
  152. Text: Stopped with an error: %tmp_err
  153. Layout: Popup
  154. Timeout (Seconds): 5
  155. Show Over Keyguard: On ]
  156.  
  157. A24: Stop [
  158. With Error: On ]
  159.  
  160. A25: End If
  161.  
  162. A26: Variable Set [
  163. Name: %TestOutput
  164. To:
  165. Step 2:
  166. %ce_account
  167. %ce_account_type
  168. %ce_all_day
  169. %ce_available
  170. %ce_calendar
  171. %ce_color
  172. %ce_description
  173. %ce_ent_time
  174. %ce_evt_id
  175. %ce_guests_can_invite
  176. %ce_guests_can_modify
  177. %ce_guests_can_see_guests
  178. %ce_is_organizer
  179. %ce_location
  180. %ce_owner_account
  181. %ce_start_time
  182. %ce_timezone
  183. %ce_title
  184. %ce_visible
  185.  
  186. * Get Calendar Attendees
  187. %ce_attendee_id()
  188. %ce_attendee_email()
  189. %ce_attendee_relationship()
  190. %ce_attendee_relationship_code()
  191. %ce_attendee_status()
  192. %ce_attendee_type()
  193. %ce_attendee_type_code()
  194.  
  195. * Get Calendar Reminders
  196. %ce_reminder_method()
  197. %ce_reminder_method_code()
  198. %ce_reminder_minutes_prior()
  199. %ce_reminder_id()
  200. Append: On
  201. Structure Output (JSON, etc): On ]
  202.  
  203. A27: End If
  204.  
  205. <Deleting old one>
  206. A28: Edit Calendar Event [
  207. Action: Delete
  208. Event ID: %event_id
  209. Continue Task After Error:On ]
  210.  
  211. <Start of error handling...>
  212. A29: Variable Set [
  213. Name: %tmp_err
  214. To: %err
  215. Structure Output (JSON, etc): On
  216. Continue Task After Error:On ]
  217.  
  218. <Error handling block>
  219. A30: If [ %tmp_err > 0 ]
  220.  
  221. A31: Variable Set [
  222. Name: %TestOutput
  223. To:
  224. Stopping after error!
  225. Error: %tmp_err
  226.  
  227. Append: On
  228. Structure Output (JSON, etc): On ]
  229.  
  230. A32: Popup [
  231. Title: Error caught
  232. Text: Stopped with an error: %tmp_err
  233. Layout: Popup
  234. Timeout (Seconds): 5
  235. Show Over Keyguard: On ]
  236.  
  237. A33: Stop [
  238. With Error: On ]
  239.  
  240. A34: End If
  241.  
  242. A35: Variable Set [
  243. Name: %TestOutput
  244. To:
  245. Step 3: Original deleted
  246.  
  247. Append: On
  248. Structure Output (JSON, etc): On ]
  249. If [ %ce_event_id Set ]
  250.  
  251. <Add new event>
  252. A36: Edit Calendar Event [
  253. Action: Add
  254. Calendar: Google:[email protected]
  255. Title: %ce_title
  256. Start Time: %ce_start_time
  257. End Time: %ce_end_time
  258. Continue Task After Error:On ]
  259.  
  260. <Start of error handling...>
  261. A37: Variable Set [
  262. Name: %tmp_err
  263. To: %err
  264. Structure Output (JSON, etc): On
  265. Continue Task After Error:On ]
  266.  
  267. <Error handling block>
  268. A38: If [ %tmp_err > 0 ]
  269.  
  270. A39: Variable Set [
  271. Name: %TestOutput
  272. To:
  273. Stopping after error!
  274. Error: %tmp_err
  275.  
  276. Append: On
  277. Structure Output (JSON, etc): On ]
  278.  
  279. A40: Popup [
  280. Title: Error caught
  281. Text: Stopped with an error: %tmp_err
  282. Layout: Popup
  283. Timeout (Seconds): 5
  284. Show Over Keyguard: On ]
  285.  
  286. A41: Stop [
  287. With Error: On ]
  288.  
  289. A42: End If
  290.  
  291. A43: If [ %ce_event_id Set ]
  292.  
  293. A44: Edit Calendar Reminder [
  294. Action: Update
  295. Event ID: %ce_event_id
  296. Reminder ID: %ce_reminder_id()
  297. Minutes Prior: %ce_reminder_minutes_prior()
  298. Method: %ce_reminder_method()
  299. Continue Task After Error:On ]
  300.  
  301. <Start of error handling...>
  302. A45: Variable Set [
  303. Name: %tmp_err
  304. To: %err
  305. Structure Output (JSON, etc): On
  306. Continue Task After Error:On ]
  307.  
  308. A46: Edit Calendar Attendee [
  309. Action: Update
  310. Event ID: %ce_event_id
  311. Attendee ID: %ce_attendee_id()
  312. Name: %ce_attendee_name()
  313. Email: %ce_attendee_email()
  314. Status: %ce_attendee_status()
  315. Relationship: %ce_attendee_relationship()
  316. Type: %ce_attendee_type()
  317. Continue Task After Error:On ]
  318.  
  319. <Start of error handling...>
  320. A47: Variable Set [
  321. Name: %tmp_err
  322. To: %err
  323. Structure Output (JSON, etc): On
  324. Continue Task After Error:On ]
  325.  
  326. <Error handling block>
  327. A48: If [ %tmp_err > 0 ]
  328.  
  329. A49: Variable Set [
  330. Name: %TestOutput
  331. To:
  332. Stopping after error!
  333. Error: %tmp_err
  334.  
  335. Append: On
  336. Structure Output (JSON, etc): On ]
  337.  
  338. A50: Popup [
  339. Title: Error caught
  340. Text: Stopped with an error: %tmp_err
  341. Layout: Popup
  342. Timeout (Seconds): 5
  343. Show Over Keyguard: On ]
  344.  
  345. A51: Stop [
  346. With Error: On ]
  347.  
  348. A52: End If
  349.  
  350. A53: End If
  351.  
  352. A54: End For
  353.  
  354. A55: Else
  355.  
  356. A56: Variable Set [
  357. Name: %TestOutput
  358. To: ___
  359. %formatted : Initiating
  360. Events in list: %ctevents()
  361. Calendar: %ctcalendar
  362.  
  363. Append: On
  364. Structure Output (JSON, etc): On ]
  365.  
  366. A57: End If
  367.  
  368. A58: Parse/Format DateTime [
  369. Input Type: Now (Current Date And Time)
  370. Output Format: HH:mm:ss
  371. Output Offset Type: None ]
  372.  
  373. A59: Variable Set [
  374. Name: %TestOutput
  375. To: %formatted : Completed!
  376. ___
  377.  
  378.  
  379. Append: On
  380. Structure Output (JSON, etc): On ]
  381.  
  382. A60: Popup [
  383. Text: Completed!
  384. Layout: Popup
  385. Timeout (Seconds): 5
  386. Show Over Keyguard: On ]
  387.  
  388. <Cleaning up>
  389. A61: If [ 1 = 1 ]
  390.  
  391. A62: Send email [
  392. Configuration: Send email from [email protected] to [email protected]
  393. Timeout (Seconds): 0
  394. Structure Output (JSON, etc): On ]
  395.  
  396. A63: Variable Clear [
  397. Name: %TestOutput ]
  398.  
  399. A64: End If
  400.  
  401.  
  402.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement