Page 1 of 1

Renaming, moving, and deleting PDFs

Posted: Wed Mar 09, 2016 8:37 pm
by montymay
I am trying to create a procedure in which the users can create a card that displays a text field for entry of an abstract of a document that is in PDF format. The card will display both the PDF in a browser object along with the text field for entry of text. The PDFs are scattered in various folders. After the abstract has been entered, I need a script that renames the selected PDF and moves it to a particular directory. The renamecommand fits the bill perfectly, except that from trials it seems to only rename and move text files. (The dictionary entry on rename does not restrict the format to text files.) From researching this forum it appears that to rename and move PDFs, the following code or something like it must be used:

Code: Select all

 put url("binfile:" & FolderPath/originalname.pdf into url("binfile:" & NewFolderPath/newname.pdf)
1. It is true that the rename command is only for text files?
2. Is "put url etc." is the correct method?
2. The preceding code does not delete the original PDF. After it is copied and put in the new directory, how do you delete the original? Delete file does not work for me.

Thanks for any replies.

Monty

Re: Renaming, moving, and deleting PDFs

Posted: Wed Mar 09, 2016 9:26 pm
by quailcreek
A wise man once said "the dictionary won't lie to you" .

Look up rename in the dictionary.
Look up delete file or delete URL in the dictionary. See the pattern here? :)

You need full privileges to the folder where the file being deleted lives.