Clipboard contents detection problem


my goal detect myself or has copied clipboard, using ctrl+c, or right click , using context menu.

 

i know air application isn't in focus, since other things going on in desktop (switching browser browser, editing photos in fireworks, etc.....) 

but tend copy text clipboard often.  , want detect when do, if air app minimized or headless.

 

so, created following code uses javascript setinterval() method, set @ 1 second.  , runs function supposed clipboard details.

 

it's not working.   can see if i'm doing wrong, or if can done?

 

------------------------------------------------------------------------------------------ --------------

<div id="infodiv"></div>

 

<script>

function everysecond() {

          setinterval("checkclipboard()",1000);

}

 

function checkclipboard(){

 

          if(air.clipboard.generalclipboard.hasformat("text/plain")){

                    var text = air.clipboard.generalclipboard.getdata("text/plain");

          }else{

                    var text = "nothing in clipboard";

          }

 

          $("#infodiv").html(text);

 

}

 

everysecond();

</script>

------------------------------------------------------------------------------------------ --------------

 

thank you!



More discussions in Archived Spaces


adobe

Comments

Popular posts from this blog

Joomla 3.3 Installation Error message - Joomla! Forum - community, help and support

Multilanguage infinite redirect loop error. - Joomla! Forum - community, help and support

trim media limit reached