I have written many scripts which involve working with two different folders.
For example, “move to”, “copy to”, “remove files with matching names in two folders” etc
So I use Quicksilver to open one of the folders in Finder (It becomes “Finder Selection” which I refer to in my script for the location of one of the folders). I also bring up the other folder in Quicksilver and use a keyboard shortcut which copies its path to the clipboard (This clipboard is used in my script to get the location of the second folder).
I have three questions:
-
Is there a better way to give my script the location of two folders?
I prefer to use Quicksilver and then copy the path to the clipboard because Quicksilver makes it easy to find the folder. -
Can one refer to the second clipboard item?
I mean first i copy “xyz” and then I copy “abc”. So “abc” becomes “the clipboard” in applescript. Is there someway, applescript (or shell script) can recognize “xyz”? -
How to test the clipboard for determining whether the contents are actually a location?
Since the location which gets copied to the clipboard begins with " and ends with (e.g. “a:abc:xya:”), it is the only criteria, I have used for testing the contents of the clipboard. But I need something more reliable because some of my scripts will end creating a file in the root folder if the clipboard contents do not refer to a path. If i edit my script which gives me the path to add more characters (e.g. #$*“a:abc:xya:”) aand then make applescript to test for those characters, then i will have to use another script to get path without those characters for my everyday use like: pasting the path in Script Editor or in a document.