Renaming, moving, and deleting PDFs

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Renaming, moving, and deleting PDFs

Post by montymay » Wed Mar 09, 2016 8:37 pm

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

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Renaming, moving, and deleting PDFs

Post by quailcreek » Wed Mar 09, 2016 9:26 pm

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.
Tom
MacBook Pro OS Mojave 10.14

Post Reply