# Can I use a macro after a JSON monitor detects a change?

**URL:** <https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808>\
**Category:** Help and Support\
**Tags:** desktop-app, macros\
**Created:** [March 4, 2025, 4:09pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808 "2025-03-04T16:09:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 4, 2025, 4:09pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/1 "2025-03-04T16:09:06Z")

</div>

I am using a JSON monitor on the MacOS app to alert to changes on a site. I would like Distill to start a macro after a change is detected. But of course, the JSON url is not the url for where the macro would run so it can’t run on the tab that opens when the JSON monitor detects a change.  
Thanks.

---

<div class="post-metadata">

**Author:** ![raksha](https://forums.distill.io/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@raksha](https://forums.distill.io/u/raksha)\
**Post date:** [March 5, 2025, 5:31am UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/2 "2025-03-05T05:31:26Z")

</div>

You can perform macro actions on a different URL (URL 2) when a change is detected on the first URL (URL 1). To do this, follow these steps:

1. Go to “Macro” and add a new macro for URL 2.
2. In the recorder, update the first step:
  - Change `wait_doc` to `open`.
  - Enter URL 2, where the macro actions should be performed.

 ![image](https://forums.distill.io/uploads/default/original/2X/6/6763d10f27c29d347a90e9a3a6d45056bbf4c12a.png)

1. Record the actions you need to perform on URL 2 and save the Macro.
2. Add this Macro as action to your JSON monitor for URL 1.

---

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 5, 2025, 12:40pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/3 "2025-03-05T12:40:52Z")

</div>

Yes, I have tried this. It works with the macro builder. The macro starts with the JSON URL and _open_ loads URL 2 and the macro continues as desired.

However, when the monitor starts if from the MacOS app, it appears (I’m not sure) that the _open_ command opens a new tab and the macro stops at that step.

---

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 5, 2025, 12:56pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/4 "2025-03-05T12:56:00Z")

</div>

I also tested it with the Chrome browser extension. The command does not appear to work at all: URL 2 is not opened and the macro times out in URL 1.

---

<div class="post-metadata">

**Author:** ![raksha](https://forums.distill.io/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@raksha](https://forums.distill.io/u/raksha)\
**Post date:** [March 7, 2025, 11:44am UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/5 "2025-03-07T11:44:42Z")

</div>

You can try adding the `wait_doc` step at the beginning of the macro, as shown below, and see if that helps.

 ![image](https://forums.distill.io/uploads/default/original/2X/5/54d114101a7fa88f24703e81c9bbaa2f36f07870.png)

---

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 7, 2025, 12:25pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/6 "2025-03-07T12:25:00Z")

</div>

I just tested a simple macro: wait\_doc, open, click

Same results: OPEN works but then the macro stops and times out before the CLICK executes.

This seems to be a bug.

Can anyone verify if the OPEN step works and allows macro steps after it?

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [March 8, 2025, 11:44am UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/7 "2025-03-08T11:44:59Z")

</div>

> [@strifet](#):
>
> Same results: OPEN works but then the macro stops and times out before the CLICK executes.

does the click step error out when the macro action is being executed? a screenshot of what you are observing will help understand what could be not working.

---

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 11, 2025, 1:21pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/8 "2025-03-11T13:21:24Z")

</div>

I did a very simple test so we can see what I’m doing wrong or if the OPEN action is broken. (I would like to monitor JSON data, but to make things simple for my test I will monitor just one element on a straight forward webpage.)

For the test monitor I have chosen [https://time.gov/](https://time.gov/) (You suggest calling it “URL 1”). It is a clock display webpage and I will monitor the UTC time element because the clock will always be different on every monitor check.

My macro called “Test” is a very simple macro with an OPEN action that will start after the monitor detects a change. It will OPEN a different webpage (URL 2), which for my test will be the [distill.io](http://distill.io) forum page. The macro will then CLICK on the “Replies” column to sort the forum topics by the number of replies and then CLICK on the topic that sorts to the top. (I also added the WAIT\_DOC action as previously suggested.)

Here is the macro export file:

```auto
{"macros":[{"meta":{"url":"https://time.gov/","blockAdsAndCookies":true},"name":"Test","spec":{"params":[]},"steps":[["wait_doc"],["open","https://forums.distill.io/"],["click",{"meta":{},"type":"css","value":".posts [aria-pressed]"},{"x":0,"y":0},{"delay":0,"frame":0,"button":"left","timeout":30,"clickCount":1}],["click",{"meta":{},"type":"css","value":"tr:first-child .main-link"},{"x":0,"y":0},{"delay":0,"frame":0,"button":"left","timeout":30,"clickCount":1}]],"version":2}]}

```

Here is a screen shot from the macro builder after hitting “Replay”. “Replay” starts the macro and it opens the URL 2, CLICK sorts the topics by largest number of replies and the second CLICK opened the topic that sorted to the top of the list (that topic is titled “Chrome extension - Watchlist not loading” and has no relation to the topic at hand). This is my desired outcome.

 ![Screenshot 2025-03-11 7.08.43 AM](https://forums.distill.io/uploads/default/original/2X/8/81325a3ffd742827124a449ac5c597b2922191d0.png)

When I run the monitor from the MAC desktop app, here is the result. The macro starts and URL 2 (the [distill.io](http://distill.io) forum page) opens, but the macro stops with no subsequent actions and the macro times out.

 ![screenshot](https://forums.distill.io/uploads/default/original/2X/f/f17d8d6f02fdfe4a7e683acae81cf1cc7348e313.png)

When I run the monitor from the Chrome browser extension (on a Chromebook) here is the result. URL 2 does not open.

 ![Screenshot 2025-03-11 6.44.11 AM](https://forums.distill.io/uploads/default/original/2X/b/bc060737e336e85dc5978e8815344497d2a8926e.png)

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [March 13, 2025, 4:16am UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/9 "2025-03-13T04:16:08Z")

</div>

> [@strifet](#):
>
> When I run the monitor from the MAC desktop app, here is the result. The macro starts and URL 2 (the [distill.io](http://distill.io) forum page) opens, but the macro stops with no subsequent actions and the macro times out.

i see. the desktop app’s `open` function doesn’t resolve. this looks like a bug in the desktop app.

> [@strifet](#):
>
> When I run the monitor from the Chrome browser extension (on a Chromebook) here is the result. URL 2 does not open.

can you try the following macro using chrome?

```json
{"macros":[{"meta":{"url":"https://time.gov/","blockAdsAndCookies":true},"name":"Test","spec":{"params":[]},"steps":[["wait_doc"],["open","https://forums.distill.io/"],["wait_for_duration",5],["click",{"meta":{},"type":"css","value":"tr:first-child .main-link a"},{"x":0,"y":0},{"delay":0,"frame":0,"button":"left","timeout":30,"clickCount":1}]],"version":2}]}

```

it was tested to work on my machine. it has following changes:

1. added a `wait_for_duration` step after `open` too ensure that click is applied only after page has loaded. i think it was trying to click too quickly.
2. changed the selector to click an `a` tag. old selector was trying to click a `td`. note that i removed the step to sort the posts to keep things simple.

let me know if it works for you or if you face any isues. thanks!

---

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 13, 2025, 12:36pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/10 "2025-03-13T12:36:00Z")

</div>

Thanks! A “wait” step is what is needed after the “OPEN” step.

I had tried that on the desktop app since I was primarily using that, but never with the browser extension.

Question:

1. Do I need to submit something on the bug in the desktop app so it will get resolved? In the future I would rather use the Mac desktop app than the browser extension.
2. Do you think [support@distill.io](mailto:support@distill.io) would reset my monthly macro actions limit since I have used over half my allowance on the desktop app bug?  
Thanks again!

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [March 14, 2025, 8:10am UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/11 "2025-03-14T08:10:10Z")

</div>

> [@strifet](#):
>
> - Do I need to submit something on the bug in the desktop app so it will get resolved?

there is no need to. i have logged this as an issue. it will get fixed in time.

please note that the desktop is in beta because. so, more bugs are expected. we fix the bugs, there are more to be fixed before it can be promoted to stable.

> [@strifet](#):
>
> Do you think [support@distill.io](mailto:support@distill.io) would reset my monthly macro actions limit since I have used over half my allowance on the desktop app bug?

the monthly usage is accounted and managed by the background services. it can’t be reset manually. it resets on the first of every month. but you send an email to [billing@distill.io](mailto:billing@distill.io) and request a credit.

---

<div class="post-metadata">

**Author:** ![strifet](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@strifet](https://forums.distill.io/u/strifet)\
**Post date:** [March 14, 2025, 7:51pm UTC](https://forums.distill.io/t/can-i-use-a-macro-after-a-json-monitor-detects-a-change/4808/12 "2025-03-14T19:51:01Z")

</div>

Thanks so much for the extra help! My macros seem to be working fine now.

In summary, an OPEN step probably needs to be followed by a wait step.  
And the OPEN step does not work on the Mac desktop app.

Thanks again.
