The first thing I’m curious about is how does the script in the extension get the string (the url) it has to process. I don’t know JavaScript but the script is simple enough to figure out what it is doing. Still, what I’m still curious about is how does PopClip does what is not specified in the script (whether it is Python or JavaScript). In the Python version, I imagine this is done via the final print statement. In the JavaScript version this seems obvious because reference to popclip is part of the return statement. The other important difference is the part where the script returns the results to PopClip. It assumes that you have already copied the string to your clipboard. One important difference (and I think here lies the explanation) is that this script does not assume that you are selecting anything with your cursor. Now, even though yours worked, I’d like to understand why this other alternative does not work. What it does is to process whatever is currently in the clipboard and return the “cleaned” version applying the regular expression. The reason I tried with this is because I am confident that the script works when executed from the terminal. I see that, besides the specific Python code you used, there are other differences in theīecause I want to understand how this works, after you provided me with the solution, I tried with the following: #popclip What I had tried, following the tutorials/documentation I found was the following: #popclip If I have one extension as a basis, I can keep creating new and possibly more complex ones to suit my needs. I wanted to do it in Python because this is the only language I feel slightly comfortable with. What a wonderful addition for a wonderful app this is! I have been a PopClip user for a long time but I was not aware of the ‘extension snippet’. I love Popclip and the more things I can do with it, the better. the extension itself, does not show up as one of the extensions available to process the selected text.Īny help you can provide would be greatly appreciated. When I select a text, however, the icon for this extension, i.e. Popclip shows me the extension is installed and I can see the icon of the extension (I borrowed this particular icon from another extension just to do a first test). When I click on the extension everything seems to work fine. You guys can check the contents yourselves. I’ve failed even in trying to achieve something this simple. I wanted to create a PopClip extension that would copy the selected URL, got rid of ? and all the characters after that and copied the clean URL to the clipboard. I like my privacy and I like to check the contents of the linked page without being tracked. The string of characters after ‘?’ is used to identify me. I tried my best following the instructions in ( GitHub - pilotmoon/PopClip-Extensions: Documentation and source code for PopClip extensions.) but I failed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |