0

I have an app which display the number of minutes passed within a specific status

for e.g I'm online now since 102 min , the result of my script return {"Online for 102:40"}

How can I get the value of the totals minutes spend in the same status ?

e.g if I go online 10min then offline 5min, then online again 50 min I would need to save value to get some report like :

" Total Online time : 60min, Offline 5min "

I wrote this for now but this only get the current value in the specific status as text.

repeat
    delay 1
    tell application "System Events"
        tell process "app name"

            try 
                set mYTAuxChecker to get value of static text of group 2 of toolbar 1 of window "app name" as text
            on error
                --
            end try
        end tell
    end tell
end repeat

to get the int I did this

set s to quoted form of mYTAuxChecker
do shell script "sed s/[a-zA-Z\\']//g <<< " & s
set dx to the result
set numlist to {}
repeat with i from 1 to count of words in dx
    set this_item to word i of dx
    try
        set this_item to this_item as number
        set the end of numlist to this_item
    end try
end repeat

and to get the world I made this

set mYTAuxCheckerAsText to first word of mYTAuxChecker

but then how can I summarise each statues and sum the total

  • "I know that my approach don't make much sense" That's honestly the only part of the question that did make sense. Any way you can edit your question and try and explain it in a different way ? And please tell us what app it is you are using—it's next to impossible to provide assistance otherwise. – CJK Sep 22 '18 at 14:48
  • I did but it's probably to complex anyway – Kevin Sep 23 '18 at 7:23

You must log in to answer this question.

Browse other questions tagged .