Advertisement
Guest User

Untitled

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