The save panel is a nice feature of Applescript Studio but my problem is that it does not actually “save” the item.
I have never been able to save a file item under another name.
Am I missing something or is this not possible?
If not, What is the use of the save panel?
I can’t ask the user if he/she would first change the name of an item and then try to copy again.
The user should be able to “save as” an item.
I don’t know. I just can’t get it done.
The save panel is not a tool for users, but rather for you as a developer. It allows you to ask the user where something is to be saved. All the save panel accomplishes is providing you with a file PATH. From there you can do whatever you want with that path.
Typically, you open a save panel, and the user selects where they would like to save something. Then you must add some code that actually saves the file. As I outlined in my other post, saving a file is easy. Of course, a more comprehensive save file routine would check for the existence of files, use try blocks to handle errors, and would probably gather information differently than I outlined in my post, but the concept is there.
Cocoa is a powerful tool to help developers build applications. It does not, however, build them for you.
I understand about the save panel.
I tried your method and I am sorry to say that it only works with text files. It also destroys the original icon and replaces it with a standard text file icon and that may never happen.
I have not been clear about the actual problem:
I am dealing with a folder that can contain any item, an image, a document, a folder etc.
I need to place these items separately in various folders and if the name already exists, save it under another name.
Isn’t there any “call method” to do this?
I cannot understand that this must be so hard to do.
The Finder for example has all the variables it needs to save an item under another name.
Something like:
duplicate inputPath to outputFolder with properties {name:“myname”}
I can’t be the only one that has to deal with this problem?