# Text output and formatting from the clipboard copyname

**URL:** https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252
**Category:** Help & Support
**Created:** [February 18, 2010, 12:19am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252 "2010-02-18T00:19:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![adrianggordon](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@adrianggordon](https://resource.dopus.com/u/adrianggordon)
#### Post date: [February 18, 2010, 12:19am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/1 "2010-02-18T00:19:17Z")

</div>

Hi,

I'm trying to make a button which will output a textfile containing formatted html to enter onto a website using a folder of jpegs as the source. The aim to avoid having to copy and paste for however many images there are each dir a line of code into the site. The site isself is very simple and for various reasons i'm not using asp, php or perl.

Looking through the FAQ it seems possible but i cant get the output to work. It worked once, i moved on to get it to do more, and hasnt worked again, even with what i thought was the same code that had worked before.

As far as I can tell the following should produce a text file called html.txt contaiing a list of all the JPG filenames in that folder.

`SELECT {file$|ext=*.jpg}
CLIPBOARD COPYNAMES=nopaths 
CLIPBOARD PASTE TO FileType=".txt" NEWNAME="html"
`

Further form this I'd like to prefix each file name with some html (ie \<img src="website/path/)then the image name and suffix it with the closing statement. The other thing i need to add is the folder into the path, which wont necissarily be the same name as where the pictures are.

If i'm asking for the moon on a stick please say so and i'll find another route but ultimately the output i'm looking for from say E:/pics01/img\_100.jpg would be: ![](https://resource.dopus.com/website/pics01/img_100.jpg).

I think i can work the rest of what i need to do out from there but thats the stumbling block at the moment.

Cheers for any advice.

Adrian[/code]

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [February 18, 2010, 12:21am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/2 "2010-02-18T00:21:55Z")

</div>

[[Copy IMG links to Clipboard with Width and Height](http://resource.dopus.com/t/copy-img-links-to-clipboard-with-width-and-height/5972/1))

---

<div class="post-metadata">

### Author: ![adrianggordon](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@adrianggordon](https://resource.dopus.com/u/adrianggordon)
#### Post date: [February 18, 2010, 12:25am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/3 "2010-02-18T00:25:05Z")

</div>

I spent at east an hour pouring over searches and the faq and managed to gloss right over it. Should probably sleep rather than try and code. Thanks leo 🙂😊

---

<div class="post-metadata">

### Author: ![adrianggordon](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@adrianggordon](https://resource.dopus.com/u/adrianggordon)
#### Post date: [February 18, 2010, 12:49am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/4 "2010-02-18T00:49:07Z")

</div>

I'm having a couple of problems taking this further. The entire html that needs to be done comprises of a number of arguments which are in " ", and when that's put into 'strUrlPrefix =' it breaks because i'm assuming it sees the following " as the end of its argument.

The entire prefix code i wish to produce is as follows:

```auto
<li><a onclick="return showPic(this)" href="photos/
```

followed by the folder/img output, followed by:

```auto
 "><img src="photos/
```

Then the folder again, then:

```auto
/thumbs/
```

Then the image name again, then:

```auto
"></a></li>
```

Perhaps i'm in a bit over my head with VB, never been a strong point.

Thanks again.

---

<div class="post-metadata">

### Author: ![adrianggordon](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@adrianggordon](https://resource.dopus.com/u/adrianggordon)
#### Post date: [February 18, 2010, 12:51am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/5 "2010-02-18T00:51:03Z")

</div>

Whoops, forgot to add a complete string using the E:/pics01/img\_100.jpg example:

```auto
<li><a onclick="return showPic(this)" href="photos/pic01/img_100.jpg"><img src="photos/pocs01/thumbs/img_100.jpg"></a></li>
```

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [February 18, 2010, 10:11pm UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/6 "2010-02-18T22:11:36Z")

</div>

In VB if you want to put a quote in a string you use two quotes "like ""this""" (which would turn into like "this").

---

<div class="post-metadata">

### Author: ![adrianggordon](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@adrianggordon](https://resource.dopus.com/u/adrianggordon)
#### Post date: [February 19, 2010, 12:44am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/7 "2010-02-19T00:44:32Z")

</div>

Thanks, but i still cant get it working properly. Even just using an unmodified button doesnt alter what is in the clipboard to anything different. I've tried higlighting the files which gives and error as its attempting to rename the file which alreayd exists and simply selecting/putting focus on the folder doesnt put anything into the clipboard. either when the button runs.

I really have no idea what i'm doing wrong, or more importantly where to begin debugging to find the problem.

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [February 19, 2010, 12:58am UTC](https://resource.dopus.com/t/text-output-and-formatting-from-the-clipboard-copyname/9252/8 "2010-02-19T00:58:11Z")

</div>

Can you post the function you have currently?
