Topic: Action that asks for new name and saves to desktop?

I tried making an action that accepts dragged files, opens a dialog window asking for a new filename, and then saves them to a specified folder, but I utterly failed. Is this something that is at all possible with Dropzone?
Regards

Re: Action that asks for new name and saves to desktop?

This sounds pretty similar to the Move Files & Copy Files destinations that ship with Dropzone. Have you looked at those?

If the key element is needing to rename the files before moving/copying then this is certainly possible but will require some changes to these destinations. Right click on the Dropzone app bundle then do 'Show Package Contents' and navigate into Contents/Resources/Destination Scripts and have a look at the Move Files.dropzone destination in a text editor for a starting point.

Also, see the API documentation at http://aptonic.com/api

3 (edited by busterpkeaton 2012-04-15 15:04:32)

Re: Action that asks for new name and saves to desktop?

John - thanks for your reply.
My script does sound pretty similar to Move File and Copy File but yes, the name-asking is crucial.
I did check out the script, and I tried to adapt it to fit my needs; however, as I have no experience with Ruby and very little with programming in general, I got stuck pretty quickly. This is how far I got (please don't laugh):

#!/usr/bin/ruby

# Dropzone Destination Info
# Name: Rename & save to folder
# Description: Allows you to rename files and save them to a folder of your choice
# Handles: NSFilenamesPboardType
# Creator: Buster P. Keaton
# URL: http://www.notarealURI.com
# OptionsNIB: ChooseFolder

def dragged

output = `./CocoaDialog standard-inputbox --title "Rename File" --e --informative-text "Enter new name for this file (minus extension):"`

filename = output.split("\n")[1]
  $dz.determinate(true)
  $dz.begin("Copying file...")
  Rsync.do_copy($items, ENV['EXTRA_PATH'], false)
  $dz.finish("Copy Complete")
  $dz.url(false)
end

def clicked
  escaped_path = ENV['EXTRA_PATH'].gsub(/["`$\\]/){ |s| '\\' + s }
  system("open \"#{escaped_path}\"")
end

I have no idea how I would be able to tell the program to use the inputted text as the new filename...
Help would be very welcome! This script is more or less the reason why I bought Dropzone, and it turns out to be much harder to fix than I thought.

Re: Action that asks for new name and saves to desktop?

Hi, I don't want to sound impatient, but would you please help me? I believe the script I'm looking for may be a) very useful for many people and b) very easy to program for a programmer. The API, which was advertised as "easy" on the mac app store, is in fact rather complicated for non-programmers, I'm afraid to say, and the documentation isn't much help either...

Re: Action that asks for new name and saves to desktop?

Yup, sorry for the delay. You had the right idea. I've filled in the blanks for you and the working script can be downloaded below:

http://aptonic.com/getdestination.php?n … e.dropzone

I've hosted it in the dropzone-user-scripts repository (https://github.com/aptonic/dropzone-user-scripts) so others can benefit from it also. Nice idea smile

Re: Action that asks for new name and saves to desktop?

John - That's great, thanks a lot for your help! You're going to save me hours of my time.
And it's really too much honor that you put me as the author ;-)