Page 1 of 1

Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:16 pm
by akira463
Im here again for another problem sir, i did follow chatgpt code , and also I made ideas , but it turns out it dont work properly, i do like to remove sms with match refence number, or match acct number, but it turns out to be deleted all , please help. thanks
Here's my code

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:20 pm
by rextended
ChatGPT?

Come here with real questions and probably you have real answers.

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:25 pm
by rextended
Simply one line:
/tool sms inbox remove [find where message~$ref]

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:27 pm
by akira463
ChatGPT?

Come here with real questions and probably you have real answers.

(you have revealed true phone number on images and script....)
sorry sir , i just take same ideas on chat gpt code, like this code

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:28 pm
by akira463
Simply one line:
/tool sms inbox remove [find where message~$refNum]
thankyou sir for your quick response , im gonna try it,

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:31 pm
by rextended
ChatGPT can't compete with logic of CatSTBC :lol: :lol: :lol:

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:32 pm
by akira463
still same result sir, no such item......
sms 2.PNG

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:34 pm
by akira463
ChatGPT can't compete with logic of CatSTBC :lol: :lol: :lol:
I just now knew chatgpt , I think I must go out in my cave :lol: , i thought there codes will run smooth , hahaha. still gonna think for the answers :lol: :lol:

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:34 pm
by rextended
you must remove all chatgtp and leave only my line....

The problem is the rest of the code, is wrong....

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:39 pm
by rextended
Without cycle, you can not parse all messages...

revised code

/tool sms inbox
:foreach item in=[find where phone="+63970XXXXX90" and message~"Ref\\. No\\."] do={
    :local newMess [get $item message]
    :local amount [:pick $newMess ([:find $newMess "PHP "] + 4) [:find $newMess ".00 of GCash"]]
    :local sender [:pick $newMess ([:find $newMess ". "] + 2) [:find $newMess  " w/"]]
    :local accMsg [:pick $newMess ([:find $newMess "MSG: "] + 5) [:find $newMess ". Your new"]]
    :local ref [:pick $newMess ([:find $newMess "Ref. No. "] + 9) ([:len $newMess] - 1)]
    /tool sms inbox remove [find where message~$ref]

    # do what you need here for each message

}

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 5:46 pm
by akira463
you must remove all chatgtp and leave only my line....

The problem is the rest of the code, is wrong....
hahaha, im laughing at myself now , i did just things complicated, thanks again sir! youre the best!!! :D :D :D

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 6:04 pm
by akira463
Sorry to ask again sir, but the code it does'nt seems to work , when there's a lot of sms , they just do work when it has only one sms, i did already using foreach, but still it does not work, it always says invalid internal item, what could be wrong?


this code deletes only one sms if it is only one sms in the inbox
/tool sms inbox
{

:global ref       [:pick $newMess ([:find $newMess "Ref. No. "] + 9) ([:len $newMess] - 1)]

  [/tool sms inbox remove [find where message~$ref]]
}

this one tells invalid internal item number,

:global ref       [:pick $newMess ([:find $newMess "Ref. No. "] + 9) ([:len $newMess] - 1)]
:local accNum "2021001"

:foreach i in=[find] do={
  [/tool sms inbox remove [find where message~$ref]]
}
}


Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 6:12 pm
by rextended
Does your code look like mine on post #10?
viewtopic.php?p=981064#p981049

(you have published again the number...)

It's late at your home, at midnight is better sleep...

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 6:16 pm
by akira463
Does your code look like mine on post #10?
viewtopic.php?p=981064#p981049

(you have published again the number...)

It's late at your home, at midnight is better sleep...

sorry sir, i did'nt saw it before, thankyou for mentioning it again, sorry again :( .

ok ill try it , thankyou!

Re: Removing certain sms via referene number match.

Posted: Mon Jan 30, 2023 6:26 pm
by akira463
Thankyou again sir!! It works now furpectly!!! Youre awesome!!!!