dergachev / copy-public-url

A Folder Action Script that copies to clipboard the public URL of any newly created file inside of a public folder in Dropbox or Google Drive
26 stars 3 forks source link

Make URLs more secure #4

Closed pixelite closed 11 years ago

pixelite commented 11 years ago

Add a random number to URLs so they're not as easy to guess.

dergachev commented 11 years ago

Best to rename files with a random string.

Here's an example of how to do it in applescript: http://stackoverflow.com/questions/5674551/renaming-files-sequentially-as-they-are-added-to-a-folder-using-automator-or-app

dergachev commented 11 years ago

Here's the code from the above comment:

on adding folder items to the target_folder after receiving these_items
    tell application "Finder"
       set all_images to every item of the target_folder as list
       repeat with i from 1 to the count of these_items --iterates through all the items you dropped in the folder
          set this_image to item i of these_items --the current image
          set the name of this_image to "image" & (i + the count of all_images) as string --renames the image based on the number of images already in the folder
       end repeat
    end tell
end adding folder items to
dergachev commented 11 years ago

New URL syntax is far better: http://dl-web.dropbox.com/u/12345678/screenshots/YZTQKE-Screen_Shot_2012.12.5-16.48.15.png

Now just need to update README.md, and close the issue