[HELP] - Ruby Drag and Drop script on screen element in Mac OS

73 views
Skip to first unread message

Muthu Selvan

unread,
Jun 20, 2013, 2:51:50 AM6/20/13
to rubyonra...@googlegroups.com
Hi All ,

   I am new to the ruby , i want click the object on element ( any object , Ex: Calculator)  after click i need Drag and Drop the
 
   element continuously for some time , please let me know how to do it in ruby in Mac OS ? 

 Thanks ,
 Muthu Selvan SR

Walter Lee Davis

unread,
Jun 20, 2013, 10:49:39 AM6/20/13
to rubyonra...@googlegroups.com
You'll need to use JavaScript for this. Ruby doesn't run in the browser, and drag events aren't sent to the server every. Click events only get sent to the server if they are on a link. With JavaScript, you can attach listener functions to almost any interaction gesture you like. These functions can in turn trigger HTTP requests or other DOM events or behavior.

Walter

Muthu Selvan

unread,
Jun 20, 2013, 12:06:16 PM6/20/13
to rubyonra...@googlegroups.com

Muthu Selvan

unread,
Jun 20, 2013, 12:08:42 PM6/20/13
to rubyonra...@googlegroups.com


On Thursday, 20 June 2013 07:49:39 UTC-7, Walter Lee Davis wrote:
  Thanks water , I know javascript to some extend ,i want to drag the element which is in Mac Desktop , is it possible to send the mouse event the objects which is in MAC Desktop ..? if yes please let me procedure for this ..? 

Regards.
Muthu Selvan SR
 

Walter Lee Davis

unread,
Jun 20, 2013, 1:07:21 PM6/20/13
to rubyonra...@googlegroups.com
You can drag and drop a desktop element into a browser, and after setting up the appropriate JavaScript in that browser, you can detect the drop on a particular element and do something with that dropped file. Look at the Flickr photo uploader for inspiration there. This is definitely not a Ruby thing at all, it's pure JavaScript / Browser tech.

Walter

>
> Regards.
> Muthu Selvan SR
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2229f7e1-0131-4358-929a-ab7d452fe540%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Muthu Selvan

unread,
Jun 20, 2013, 2:03:44 PM6/20/13
to rubyonra...@googlegroups.com


On Thursday, 20 June 2013 10:07:21 UTC-7, Walter Lee Davis wrote:

On Jun 20, 2013, at 12:08 PM, Muthu Selvan wrote:

>
>
> On Thursday, 20 June 2013 07:49:39 UTC-7, Walter Lee Davis wrote:
>
> On Jun 20, 2013, at 2:51 AM, Muthu Selvan wrote:
>
> > Hi All ,
> >
> >    I am new to the ruby , i want click the object on element ( any object , Ex: Calculator)  after click i need Drag and Drop the
> >  
> >    element continuously for some time , please let me know how to do it in ruby in Mac OS ?
>
> You'll need to use JavaScript for this. Ruby doesn't run in the browser, and drag events aren't sent to the server every. Click events only get sent to the server if they are on a link. With JavaScript, you can attach listener functions to almost any interaction gesture you like. These functions can in turn trigger HTTP requests or other DOM events or behavior.
>
> Walter
>
>
>   Thanks water , I know javascript to some extend ,i want to drag the element which is in Mac Desktop , is it possible to send the mouse event the objects which is in MAC Desktop ..? if yes please let me procedure for this ..?

You can drag and drop a desktop element into a browser, and after setting up the appropriate JavaScript in that browser, you can detect the drop on a particular element and do something with that dropped file. Look at the Flickr photo uploader for inspiration there. This is definitely not a Ruby thing at all, it's pure JavaScript / Browser tech.

Walter

>

  Water , 

  Is this is tool or java script .. ? if it script can you please share the code / link to me ..? 

Walter Lee Davis

unread,
Jun 20, 2013, 2:32:04 PM6/20/13
to rubyonra...@googlegroups.com

Robert Walker

unread,
Jun 20, 2013, 3:08:03 PM6/20/13
to rubyonra...@googlegroups.com
Muthu Selvan wrote in post #1113021:
> Water ,
>
> Is this is tool or java script .. ? if it script can you please share
> the
> code / link to me ..?

Take a look at this tutorial...

http://www.html5rocks.com/en/tutorials/file/dndfiles/

--
Posted via http://www.ruby-forum.com/.

Tamara Temple

unread,
Jun 22, 2013, 3:47:41 PM6/22/13
to rubyonra...@googlegroups.com
Are you trying to make a Rails web application, or a Mac desktop
application? If the latter, you have the wrong list. Try the ruby-talk
list instead.
Reply all
Reply to author
Forward
0 new messages