^c not working in excel - discogs

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
marktherob1950
Posts: 12
Joined: 21 May 2016, 14:25
Location: Toronto, Canada

^c not working in excel - discogs

22 May 2017, 15:29

I have a problem with this script in that the ^c doesn't do a clipboard copy in excel any ideas. I have an album database in Excel and when i press Ctrl Windows I it is supposed to copy the highlighted text and open discogs with this text in the clipboard. i tried sending F2 Shift Home ^C as well no luck. Please help. Thanks Mark

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.

; #SingleInstance Force

;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SendMode Input
;SetTitleMatchMode, 2 ; Used to test what app you are in
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

^#i::

Send ^c

Run chrome.exe https://www.discogs.com/search/?q="%clipboard%"

Return

+#i::

Send ^c

Run chrome.exe https://www.discogs.com/search/?q="%clipboard%"


Return
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: ^c not working in excel

22 May 2017, 18:07

Code: Select all

^#i::
	Send ^c
	ClipWait
	Run chrome.exe https://www.discogs.com/search/?q=`"%clipboard%`"
Return
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
marktherob1950
Posts: 12
Joined: 21 May 2016, 14:25
Location: Toronto, Canada

Re: ^c not working in excel

22 May 2017, 18:31

thank you @FanaticGuru
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: ^c not working in excel

22 May 2017, 18:38

You may want to restore the clipboard after use and you definitely want to empty it prior to using the command ClipWait, as it waits until the clipboard contains text which it may already do.

Code: Select all

^#i::Run, % """https://www.discogs.com/search/?q=" RegExReplace(Clip(), " ", "+") """"

Clip(wait := "", notonlytext := "") {
	OldClip := Clipboardall
	Clipboard := ""
	Send, ^c
	ClipWait, % wait, % notonlytext
	clip := Clipboard
	Clipboard := OldClip
	Return clip
}
Please excuse my spelling I am dyslexic.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: ^c not working in excel

03 Oct 2017, 07:42

Some pro-bro in here might be willing/interested to create a little AHK wrapper to access discogs via its API ?!! :)

The Discogs API v2.0 is a RESTful interface to Discogs data. You can access JSON-formatted information about Database objects such as Artists, Releases, and Labels. Your application can also manage User Collections and Wantlists, create Marketplace Listings, and more.

https://www.discogs.com/developers/

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ccqcl, Descolada, mikeyww and 376 guests