Help Applescript Needed

Hi there, can someone please help me? I need a script that will copy a file name to the clipboard, then copy said file name to another file and clear the clipboard.

Cheers :smiley:

Could you please provide a little more information? If you just need a script to add a filename to the end of file, you do not need the clipboard at all. If you are wanting to create a new file and add a filename or filenames to that, it is a little different than just appending to the end of a file. Again, you still do not need the clipboard.

More details on a request such as this will attract more scripters to your problem, and ultimately result in more quality options for you to consider.

casdvm

Please don’t double post.

Where is this “filename” coming from (how do you want to select it), and what file is it going into?

I’m not quite sure what you’re asking either. But I can tell you an interesting thing about the Finder. When you copy a file in Finder, the text of the filename is available on the clipboard. This is why for example, if you’ve copied a file (or a bunch of files) and then try to paste them into a plain text document (not rich text) you end up with a plain list of filenames.

So if you wanted to copy just the name of a file, and then change the name of a different file to match (presumably a file in a different folder) then you just copy the original file, select the destination file, hit ‘enter’ to edit its name, and then hit command-v to paste in the new text filename.

Sorry Bruce.

Right this is what I have so far using Automator. I’ve 2 hotfolders, an in and an out box. I’m combining 2 PDFs with files made of a job number of 5 numbers (12345) an underscore then a comp code made up of 8 numbers (12345678). Underscore followed by cp.pdf for the comp and sp.pdf for the sep. The workflow runs fine apart from the renaming bit, automator is just giving the new
Combined PDF any old name (i.e. QW45S.pdf).

So my self and a work mate hit on the idea of using scrpit to copy the comp PDF file name to the clipboard, remove the cp bit, and paste the new name on the to new combined PDF in the outbox.

I’m guessing the whole thing could be done with script without using Automator, but AppleScript is all a bit new 2 me (and a bit over my head).

What I’d really like is to keep the in and outbox and have a workflow that would combine the PDFs, rename them in the way I’d like (so you end up with 12345_12345678.pdf), and then remove (trash) the comp and sep PDFs.

What would also be nice is if we could drop as many PDFs as we like on the inbox. Say 6 ” 3 comp, 3 sep ” and it combines them by job number giving us 3 combined PDFs back. (Say you have 12345_12345678_cp.pdf and 12345_12345678_sp.pdf, but you also have 54321_87654321_cp.pdf and 54321_87654321_sp.pdf, the work flow only combines the job numbers that match so we get the result of 12345_12345678.pdf and 54321_87654321.pdf)

(Hope this all makes sense)

Cheers all minty :smiley: