My own productivity app

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

My own productivity app

Terry Vogelaar
I want to write my own productivity app in LiveCode. Aren’t there enough? Maybe, but I haven’t found what I’m looking for.

Here’s what I have. I use MacBreakZ (http://www.publicspace.net/MacBreakZ/ <http://www.publicspace.net/MacBreakZ/>) to prevent RSI. It lets me take breaks when I’m using the Mac for too long. The great thing is that it detects whether I use my Mac or not. So when I’m interrupted, the timer delays the break and it will eventually notify it as an informal break.

Then there is Focus (https://heyfocus.com <https://heyfocus.com/>). I tend to waste my most productive hours on Facebook or e-mail. Focus is basically a timer to restrict the usage of distracting apps or sites to help me with my self-control during those hours.

Then there is another app, also called Focus (https://masterbuilders.io <https://masterbuilders.io/>). I hoped it would have the restricting functionality of the other Focus, but no, this is just a simple Pomodoro timer with an integrated ToDo-list. It gives 4 blocks of productivity, 25 min each, with a 5 min break in between. Then there’s a longer break.

All of them help users to have productive time and leisure time. But if I would run all three, there would be no agreement between them when I should have my break.

The latter app made me realise I could create my own. Any programmer could make that. But ideally I would want to integrate what makes the other two apps great. I want the activity detection that MacBreakZ has and the distraction-restriction (hey)Focus offers. Would an app made in LiveCode be able to do that? If so, how?



With kind regards,
Terry Vogelaar

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: My own productivity app

J. Landman Gay
On 11/28/16 9:29 PM, Terry Vogelaar wrote:
<snippage>
> All of them help users to have productive time and leisure time. But
> if I would run all three, there would be no agreement between them
> when I should have my break.
>
> The latter app made me realise I could create my own. Any programmer
> could make that. But ideally I would want to integrate what makes the
> other two apps great. I want the activity detection that MacBreakZ
> has and the distraction-restriction (hey)Focus offers. Would an app
> made in LiveCode be able to do that? If so, how?

The problem I see here is that LC has no knowledge of what other apps
are in use, and provides no feedback when it isn't the frontmost app.
There may be shell calls you could use to get some of the information,
but I kind of doubt there's a way to monitor keystrokes and that sort of
thing.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: My own productivity app

Mike Bonner
The only way I know of to monitor keystrokes/mouse events is with a loop.
Check to see if keysdown() is empty, and "if the mouse is down."   Certain
things won't trigger the mouse is down such as grabbing a title bar and
dragging it around (on windows)  but most other clicks will work fine.

For a simple test, I made a stack with a field and a button. the following
code is in the button.
local sRunning

on mouseUp
if sRunning is empty then put false into sRunning
put not sRunning into sRunning
loopit
end mouseUp

command loopit
if sRunning then
   if the keysdown is not empty then
      put keysdown() into field 1
   else
      put empty into field 1
   end if
   if the mouse is down then
      set the backgroundcolor of field 1 to red
   else
      set the backgroundcolor of field 1 to empty
   end if
   send loopit to me in 100 millisec
end if
end loopit

Placing the window where its visible but not focused and work with another
program.  Every click the field turns red, every keypress and the keys that
are down show up in the field.  With a delay of 100 seconds its possible to
miss an event, but if a person were actually working actively most
keypresses and clicks will be caught.  It should be possible to use either
applescript or vbscript to note what window is focused, though im not sure
how to tell if one is working in a facebook tab or not.

On Tue, Nov 29, 2016 at 1:14 PM, J. Landman Gay <[hidden email]>
wrote:

> On 11/28/16 9:29 PM, Terry Vogelaar wrote:
> <snippage>
>
>> All of them help users to have productive time and leisure time. But
>> if I would run all three, there would be no agreement between them
>> when I should have my break.
>>
>> The latter app made me realise I could create my own. Any programmer
>> could make that. But ideally I would want to integrate what makes the
>> other two apps great. I want the activity detection that MacBreakZ
>> has and the distraction-restriction (hey)Focus offers. Would an app
>> made in LiveCode be able to do that? If so, how?
>>
>
> The problem I see here is that LC has no knowledge of what other apps are
> in use, and provides no feedback when it isn't the frontmost app. There may
> be shell calls you could use to get some of the information, but I kind of
> doubt there's a way to monitor keystrokes and that sort of thing.
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: My own productivity app

Terry Vogelaar
In reply to this post by Terry Vogelaar
Thank you, Jacqueline and Mike, for your responses.

Jacqueline wrote that LC provides no feedback when it isn't the frontmost app. But is there a way to use MacOS's Notification Center from within LiveCode to tell me things like that?

Mike's solution using a timed loop seems to do the trick to add the MacBreakZ functionality. So the app and site blocking functionality is the only thing that is hard to implement. But for that, I could use (hey)Focus; this app is the least intrusive of the three I mentioned. So I could make my own Pomodoro-timer with a ToDo-list and the MacBreakZ-functionality, and let (hey)Focus do the site/app blocking.

Heck, key logging, site blocking, disabling of other apps… It sounds like I'm brewing up something evil. (But I'm not.)

Thanks for the help.


With kind regards,
Terry Vogelaar


> The only way I know of to monitor keystrokes/mouse events is with a loop. Check to see if keysdown() is empty, and "if the mouse is down.”  Certain things won't trigger the mouse is down such as grabbing a title bar and dragging it around (on windows)  but most other clicks will work fine.
>
> For a simple test, I made a stack with a field and a button. the following code is in the button.
> local sRunning
>
> on mouseUp
> if sRunning is empty then put false into sRunning
> put not sRunning into sRunning
> loopit
> end mouseUp
>
> command loopit
> if sRunning then
>   if the keysdown is not empty then
>      put keysdown() into field 1
>   else
>      put empty into field 1
>   end if
>   if the mouse is down then
>      set the backgroundcolor of field 1 to red
>   else
>      set the backgroundcolor of field 1 to empty
>   end if
>   send loopit to me in 100 millisec
> end if
> end loopit
>
> Placing the window where its visible but not focused and work with another program.  Every click the field turns red, every keypress and the keys that are down show up in the field.  With a delay of 100 seconds its possible to miss an event, but if a person were actually working actively most keypresses and clicks will be caught.  It should be possible to use either applescript or vbscript to note what window is focused, though im not sure how to tell if one is working in a facebook tab or not.
>
>> The problem I see here is that LC has no knowledge of what other apps are in use, and provides no feedback when it isn't the frontmost app. There may be shell calls you could use to get some of the information, but I kind of doubt there's a way to monitor keystrokes and that sort of thing.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: My own productivity app

xtalkprogrammer
Hi Terry,

It used to be possible to get the front-most app with AppleScript. Due
to sandboxing, this may no longer apply, but perhaps signing the app (or
turning off Gate Keeper) will allow this again?

Kind regards,

Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch

Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com

Op 30-Nov-16 om 09:17 schreef Terry Vogelaar:

> Thank you, Jacqueline and Mike, for your responses.
>
> Jacqueline wrote that LC provides no feedback when it isn't the frontmost app. But is there a way to use MacOS's Notification Center from within LiveCode to tell me things like that?
>
> Mike's solution using a timed loop seems to do the trick to add the MacBreakZ functionality. So the app and site blocking functionality is the only thing that is hard to implement. But for that, I could use (hey)Focus; this app is the least intrusive of the three I mentioned. So I could make my own Pomodoro-timer with a ToDo-list and the MacBreakZ-functionality, and let (hey)Focus do the site/app blocking.
>
> Heck, key logging, site blocking, disabling of other apps… It sounds like I'm brewing up something evil. (But I'm not.)
>
> Thanks for the help.
>
>
> With kind regards,
> Terry Vogelaar
>
>
>> The only way I know of to monitor keystrokes/mouse events is with a loop. Check to see if keysdown() is empty, and "if the mouse is down.”  Certain things won't trigger the mouse is down such as grabbing a title bar and dragging it around (on windows)  but most other clicks will work fine.
>>
>> For a simple test, I made a stack with a field and a button. the following code is in the button.
>> local sRunning
>>
>> on mouseUp
>> if sRunning is empty then put false into sRunning
>> put not sRunning into sRunning
>> loopit
>> end mouseUp
>>
>> command loopit
>> if sRunning then
>>   if the keysdown is not empty then
>>      put keysdown() into field 1
>>   else
>>      put empty into field 1
>>   end if
>>   if the mouse is down then
>>      set the backgroundcolor of field 1 to red
>>   else
>>      set the backgroundcolor of field 1 to empty
>>   end if
>>   send loopit to me in 100 millisec
>> end if
>> end loopit
>>
>> Placing the window where its visible but not focused and work with another program.  Every click the field turns red, every keypress and the keys that are down show up in the field.  With a delay of 100 seconds its possible to miss an event, but if a person were actually working actively most keypresses and clicks will be caught.  It should be possible to use either applescript or vbscript to note what window is focused, though im not sure how to tell if one is working in a facebook tab or not.
>>
>>> The problem I see here is that LC has no knowledge of what other apps are in use, and provides no feedback when it isn't the frontmost app. There may be shell calls you could use to get some of the information, but I kind of doubt there's a way to monitor keystrokes and that sort of thing.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553