Applescript Help, Moving a Chrome Bookmark Link Under the Mouse to a Tab in Window 2

I have bookmark manager on left window chrome, read them on right window chrome, when I hover on link in bookmark manager I can't move them to right window without slow process of load then transfer, I know there are some skilled apple script makers here, it would be much appreciated, a script to open tab link from under mouse cursor (left window) to new tab in other window (right window), so I can assign a shortcut.

thanks much.

Hey @Lon_Ron,

What bookmark manager?

The built-in bookmarks page in Google Chrome?

If you haven't read this it's worth a couple of minutes of your time.

Tip: How Do I Get The Best Answer in the Shortest Time?

-Chris

Hi ccstone

no, it's an extension bookmark manager called clipd.io, I organize groups about subjects I need to learn, just dump them there to be reviewed later properly, the problem is, when you right click the links, there's not much options, but there are links under hover. I need a way to push these links the the new (right if the manager is left) window I have open as a new tab there.

So, I can do it the slow way opening them all in left window tabs, highlighting with shift click then right click and move to, but if I could have an applescript script to do the same thing from hover it would save me so much time, any help is much appreciated, other applescript forums are so indifferent/hostile.

the script would include a keypress macro, which I would later change to a mouse trackpad gesture with bettertouchtool but I can do all that myself, just the applescript I can't do, I'm going to start to learn applescript, but won't be able to learn well without this script and this filtering system because there's so much information online.

I got a little help from apple forums, something about system events, either in applescript or macro that will briefly switch windows, but I'm still not sure how to apply it.

tell application "System Events"

tell process "Chrome"

	perform action "AXRaise" of window 2

end tell

end tell

Hey @Lon_Ron,

Too bad other forums are not helpful...

This problem is fairly complex though.

What happens when you right-click on a link in the Clipd.io window?

Is there a contextual menu?

Can you type-select in the contextual menu?

-Chris

I guess the issue was more complex than I thought, but even for easy problems, generally programming (especially applescript) help forums are rough, except this one, that's why I want to learn it myself to stop bothering people about automation help.

clipd.io is weird, the links inside work if you click on them, and I can command click to open new tab and stay on current page, but their context menu is different than other links, less options.

Screen Shot 2020-11-16 at 7.18.47 PM

That's often the case with programming and automation.  :sunglasses:

Trying to write code to do this job might be possible but would probably be very complicated and require an intimate knowledge of JavaScript.

What I would try first is to simulate a click-hold and drag.

Move the cursor over the bookmark you want to open, and run the macro with its keyboard shortcut.

If it does pick up and drag the bookmark as desired then you may or may not have to tweak the offsets I've set for the end-point of the drag.

This is likely the simplest solution if it works.

-Chris


Open Bookmark in Chrome Window 2.kmmacros (6.5 KB)

I've got this dragging to the Tab-Bar on my system, so it automatically creates a new tab.

If you can't get that to work we can manually create a new tab with AppleScript.

-Chris

ok thanks very much sorry I was afk, I'll try it out.

I tried it, it moves the mouse cursor in the vicinity of a new tab but doesn't open up a new tab unfortunately. I tried in the bookmark manager and just a regular google link, I can I make a video if you want.

Good idea.

k I'll make one shortly.

sent pm.

Hey @Lon_Ron,

Well...  This was a pesky problem and is utterly impossible to achieve directly with AppleScript or JavaScript.

However -- once again Keyboard Maestro makes the impossible possible.

It was also impossible to solve without being able to directly test the Clipd.io extension.

The macro is a bit clunky, but it's way faster than doing the job by hand.

On my system Shift-Click will open a clicked link in a new window -- this is required for the macro to work correctly. If that doesn't work on your system then we need to figure out what modifier-combination-click will open the link in the front window.

Let me know how it works for you.

-Chris


Open Bookmark in Chrome Window Two v2.0.kmmacros (10 KB)

I really appreciate you sticking with this, I think it worked!

I set it to a hot key, and it opens and closes quickly windows quickly but that's fine, I'll set it to a bettertouchtool mouse gesture and it'll be fast.

btw clipd.io is back up if you wanted to try it but I tried it on there and it worked like any other link.

:yum:

Good deal!

Yeah -- there's no way to extract the link from the Clip.io bookmark manager, so brute force is required.

With a regular link you can scrape the link from a mouse-hover location, but whatever the developer is doing breaks that in Clip.io's bookmarks panels. Although some of the links in other parts of the U.I. work fine.

I did install it last night. I couldn't have solved the issue otherwise.

-Chris

1 Like