publicLink: the process
In this post I will explain the process of my action/script for quicksilver. The action is quite simple; you choose a file that is currently on your public folder via quicksilver and then run the publicLink action to get the public link and paste it anywhere you need it.
I started using Quicksilver and loved functions like move to and copy to. Then I started using dropbox and using the copy to and move to the dropbox folder. The problem was that I had to manually get the public link for any file in the dropbox folder. This was very disruptive when you are used to using quicksilver and its simple functions. Also, I always had to get the main index file from my dropbox folder (search: pyndexer) so it was not productive getting the same link over and over again manually.
The usual solution:
Search. I started searching for the solution but I had no luck. So I decided it was time to use my programming skills and make it myself.
I searched for the requirements for a quicksilver script. I found that you needed applescript knowledge. This was the first time I heard of this scripting language so I decided to read a couple of things and look for examples.
I came across three vital webpages that I used for my solution.
I knew I needed a find and replace algorithm so I decided to search for a pre-made one. The first link was useful for seeing how to interact with the clipboard. The third link was useful for seeing different examples and one script very similar to my solution but different at the same time.
Testing the work:
When I finished my script, I didn’t worried about a method to see if there were characters not used in URLs like spaces and other symbols. I decided to try it and see how it worked without it. It worked! It turns out that most browsers (if not all, I tried with 3) replace this characters when pressing enter and it redirects you to the correct webpage. I did a quick test to see different types of names of the files and everything worked.
What I learned:
I learned that it’s pretty awesome to develop your own solutions. I felt powerful. Also I wanted to share the solution if somebody else needs it. It’s pretty cool what you can achieve in a long night with some searching skills and basic developing knowledge.