is there an BTT action to drag one item?

I was wondering if a native BTT solution was existing for dragging some element from one position to another. (I tried the action "move" but it did not work)

Actually, I found some python script to do that (original credit to https://discussions.apple.com/thread/2506837) but I would have prefer a pure BTT method.

import sys
import time
import Quartz.CoreGraphics as Q
#from Quartz.CoreGraphics import * # imports all of the top-level symbols in the module
def mouseEvent(type, posx, posy):
 theEvent = Q.CGEventCreateMouseEvent(None, type, (posx,posy), Q.kCGMouseButtonLeft)
 Q.CGEventPost(Q.kCGHIDEventTap, theEvent)
def mousemove(posx,posy):
 mouseEvent(Q.kCGEventMouseMoved, posx,posy);
def mouseclickdn(posx,posy):
 mouseEvent(Q.kCGEventLeftMouseDown, posx,posy);
def mouseclickup(posx,posy):
 mouseEvent(Q.kCGEventLeftMouseUp, posx,posy);
def mousedrag(posx,posy):
 mouseEvent(Q.kCGEventLeftMouseDragged, posx,posy);
#ourEvent = CGEventCreate(None);
#currentpos=CGEventGetLocation(ourEvent); # Save current mouse position
mouseclickdn(1533, 59);
for i in range(1500, 0, -100):
    mousedrag(i, 62);
    time.sleep(0.025)
mousedrag(59, 62);
time.sleep(1);
mouseclickup(59, 62);
Imprint | Privacy Policy