Macro for blocking specific chats but not messaging apps themselves

Hello, pals! :giggle:


Have you ever used an app to block other apps to avoid wasting too much time, such as StayFree, DigitalDetox, etc.?

If so, have you ever used such blocking apps like these to block messaging apps like WhatsApp, Telegram, Signal, etc.?

If that applies to you, have you ever wished you could have the option to block specific chats instead of the whole app, because there are chats there that you still would need to use in your day to day life without being blocked (e.g. Telegram's Saved Messages?)?


Well, thanks to user LF0's help with a different macro (Screen Content Macro to Prevent Uninstalling Apps), I have learnt how to create a Macro that blocks specific chats but does not block messaging apps as a whole.



PREPARATIONS
  1. If you're reading this by using a search engine on how to blocking chats but don't have Macrodroid installed, get this app from the Google Play Store (only for Android).

  2. Go to the messaging apps whose chats you want to block, and write a new message or edit the first few words of an old message in that conversation to put an chat blocking identifier code that helps you identify the chats to block, e. g. schedule_block, macrodroid_block, etc.

    Note: Not all apps will let you pin messages, and not all apps pin messages forever: e.g. WhatsApp can only let you pin messages for 24 hours, 7 days or 1 month; Telegram does this just fine.

  3. Pin that message *just for you* to be visible in chats with these people or groups you want to block.
    It should look like this:
    wKsnam4.png


  4. Create the macro 'Chat Blocking' following the steps below.




MACRO 'CHAT BLOCKING'
TRIGGER
  • Screen Content (On Screen)
    • Applications: WhatsApp, Telegram (any app for messaging in which there are chats you want to block)
    • App activity: On Screen
    • Match Option: Text content
    • Text to match: (chat blocking identifier code)
    • Read Screen Update Rate: 0,1.
CPPO1fU.png
tWaSXxk.png




ACTION
  • Check Text On Screen
    • Text condition: Matches
    • Text: (person1)|(person2)|(person3)
      • Note 1: In the name of each person must be the *full name* of that person or group as it appears in their chat, not just a word from the name.
      • Note 2: I have given 3 chat names as an example, but you can really block as many chats as you want, as long as you separate them between Vertical bars |.
    • Enable regular expression matching: Yes
    • Save on screen state to boolean variable: (create new)
      • Enter variable name: e. g. chat_blocking
      • Create variable now: Yes
  • Launch Home Screen
    • Add Constraint
      • MacroDroid Variable
        • Select MacroDroid variable: chat_block_app
pYhGvq5.png



CONSTRAINTS
Note: optional, if you want the chat blocking to work only according to time blocks of the day.
(Mode: OR)
  • Time of Day
    • From (Time A) to (Time B).

XjzEutG.png






HOW TO PREVENT CHANGES ON THIS MACRO or UNINSTALLING MACRODROID
Please read the thread 'Screen Content Macro to Prevent Uninstalling Apps' (thanks to Endercraft and Jacob L for their help!)




I hope this helps :)
 
Last edited:

Dm114

Well-known member
Hello, pals! :giggle:


Have you ever used an app to block other apps to avoid wasting too much time, such as StayFree, DigitalDetox, etc.?

If so, have you ever used such blocking apps like these to block messaging apps like WhatsApp, Telegram, Signal, etc.?

If that applies to you, have you ever wished you could have the option to block specific chats instead of the whole app, because there are chats there that you still would need to use in your day to day life without being blocked (e.g. Telegram's Saved Messages?)?


Well, thanks to user LF0's help with a different macro (Screen Content Macro to Prevent Uninstalling Apps), I have learnt how to create a Macro that blocks specific chats but does not block messaging apps as a whole.



PREPARATIONS
  1. If you're reading this by using a search engine on how to blocking chats but don't have Macrodroid installed, get this app from the Google Play Store (only for Android).

  2. Go to the messaging apps whose chats you want to block, and write a new message or edit the first few words of an old message in that conversation to put an chat blocking identifier code that helps you identify the chats to block, e. g. schedule_block, macrodroid_block, etc.

    Note: Not all apps will let you pin messages, and not all apps pin messages forever: e.g. WhatsApp can only let you pin messages for 24 hours, 7 days or 1 month; Telegram does this just fine.

  3. Pin that message *just for you* to be visible in chats with these people or groups you want to block.
    It should look like this:
    wKsnam4.png


  4. Create the macro 'Chat Blocking' following the steps below.




MACRO 'CHAT BLOCKING'
TRIGGER
  • Screen Content (On Screen)
    • Applications: WhatsApp, Telegram (any app for messaging in which there are chats you want to block)
    • App activity: On Screen
    • Match Option: Text content
    • Text to match: (chat blocking identifier code)
    • Read Screen Update Rate: 0,1.
CPPO1fU.png
tWaSXxk.png




ACTION
  • Check Text On Screen
    • Text condition: Matches
    • Text: (person1)|(person2)|(person3)
      • Note 1: In the name of each person must be the *full name* of that person or group as it appears in their chat, not just a word from the name.
      • Note 2: I have given 3 chat names as an example, but you can really block as many chats as you want, as long as you separate them between Vertical bars |.
    • Enable regular expression matching: Yes
    • Save on screen state to boolean variable: (create new)
      • Enter variable name: e. g. chat_blocking
      • Create variable now: Yes
  • Kill Application
    • Select Option: Select Application
    • Select Application(s): (same apps as in 'Screen Content (On Screen)' trigger)
    • Add Constraint
      • MacroDroid Variable
        • Select MacroDroid variable: chat_block_app
pYhGvq5.png



CONSTRAINTS
Note: optional, if you want the chat blocking to work only according to time blocks of the day.
(Mode: OR)
  • Time of Day
    • From (Time A) to (Time B).

XjzEutG.png






HOW TO PREVENT CHANGES ON THIS MACRO or UNINSTALLING MACRODROID
Please read the thread 'Screen Content Macro to Prevent Uninstalling Apps' (thanks to Endercraft and Jacob L for their help!)




I hope this helps :)
This forum is made for real MD users Not for promoting other apps or macros created by AI (ChatGPT)...
 
This forum is made for real MD users Not for promoting other apps or macros created by AI (ChatGPT)...
Sorry, but... What?

This thread or my macro has nothing to do with ChatGPT or any AI... I am a real user. A human being.

And I am not promoting any app aside from Macrodroid, but I had to mention other apps related to the needs for this Macro.

Have you read the thread? This message looks a bit generic. Is this a bot?

Maybe... this is a joke? Sorry I didn't understand.
 

Dm114

Well-known member
Sorry, but... What?

This thread or my macro has nothing to do with ChatGPT or any AI... I am a real user. A human being.

And I am not promoting any app aside from Macrodroid, but I had to mention other apps related to the needs for this Macro.

Have you read the thread? This message looks a bit generic. Is this a bot?

Maybe... this is a joke? Sorry I didn't understand.
Sorry but your post is very similar to those generated by ChatGPT we sometimes find here and there...

Furthermore I'm afraid your macro won't work for several reasons. But, anyway, good luck and have a nice day.
 

Endercraft

Moderator
Honestly with the number of ai generated threads we have, it's easy to recognize what is and what isn't (you might not see a lot because we delete them quickly). Remembering real users is also easy once you start looking at every thread.

It is true however that this macro has already been created many times (and the kill app action only works for rooted users).
 
Last edited:
Yeah, you say "Correct!" to that part of the quote, but you forget to quote the part of Endercraft that tells how *you* were not so "Correct" :cautious:.


Thank you Endercraft, because I forgot Root is needed 🙏.
I can delete my post if it's a Dupe. Sorry I didn't use the Search function properly.
 
Hey, Endercraft, thank you again for providing feedback on this Macro 🙏.

I have been thinking how to fix it. I've come to the conclusion that if this Macro's intent is not blocking the app as a whole, probably it would make more sense that it didn't *kill* the app as a whole.

So I could set it up just to kick the user out of the chat by performing a "Simulate 'Back' command" action instead of a 'Kill app" action, so it makes the user go back to the list of chats instead of killing the app.

- USER: (enters the *wrong* chat) hehe 😈🙏
- MACRODROID: HUH!? 👺💢 (*TRIGGERED*)
(MacroDroid slaps the user out of the chat room 💥)
- USER: (in the list of chats) okay, okay! 😰🙌
- MACRODROID: (after action) hehe! 🤖👌

I have MacroDroid blocked for now, but I will check later for Root/Pro restrictions for different actions.
Also I will search for threads already sharing this kind of "selective screen-blocking" macros.

Thank you for your support and have a nice day 🙏

EDIT: I just edited the main post. Kill Application action will be replaced by Launch Home Screen action to avoid Root requirements.
 
Last edited:

JoeReMi

Member
Hi! I've been messing with a similar macro. It's been very funstrating!

Right now it presses the back button every 5 seconds when
  • Google is the foreground app and the Discover stories are detected
  • Lock Me Out/AppBlock is the foreground app and the map screens are detected (no more spending hours following the course of the Nile river like a dingus. Should probably tweak this so I can still use the functionality)
  • Freedom is the foreground app and the blog posts are detected (no idea why they thought including these in a blocking app would be a good idea)
  • WhatsApp is the foreground app and the "conversation_contact_name" element does not contain certain contact names
1723138038202.png


I have something similar for MacroDroid itself but as it is obviously a bit of a risky macro it's separate. It blocks access to the main app but still allows for popup windows like selection dialogs and variable entry
 
Last edited:
Top