ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Using script to copy multiple image files to a page

<< < (2/3) > >>

questorfla:
I will try. 
Each Project has an image created for it called invite.png. Each one is a specific picture that is like a miniature of the login page that section of the main site.  During creation of each new Project, there is a script that takes several components to create this and performs many other housekeeping functions. 
The Names for each project are kept as short as possible by using initials that com from the project name so it could be www.projects.com\joedoe\cdcsoi.  This is short and simple but if you were to see that name later and it was one of a 100 others you have no way to know for sure what it is.
The "invitation" is a 30% reduction image of the complete login page which makes it easy on humans to see what the initials stand for.
in this case: joe doe is looking for a chief dog catcher (for the) state of Illinois.
During the creation of the project, when i have the invite.png file at hand if i could add the invite.png as a PICTURE to a WORD doc listing all the Projects along with their URL's it would be a handy thing to have

I already make a list of the URL's but "1 picture speaks 1000 bytes"  I could embed the URL into the png and the person using the list could just click the invite.png image to get to that Project page

In order to do this and make it fully automatic, i have to be able to copy that image and add it to the Site List plus Use the Hyperlink took to embed the URL within the original creation script

I can go back afterward and do this on a one by one basis very easy.  Copy the invite.png, paste to word doc , it pastes just fine as an image cRight click the image click the hyperlink option and type in the correct URL.
Job done to perfection.

But it is a lot more complicated thanvthat and i have all the parts needed at hand when the site is created to be able to automate the creation of the picture list with embedded URL's if i had a command that would runs in the script.

Think of it like a catalog where you click the image to open to the page for the description of the item.  Pretty easy straightforward stuff and i was amazed to find out that while i can find a ton of ways to do it in LINUX Windows apparently does not have a "copy file as Image option.  And definitely not one that had scriptable command line interface for automation.

Using script to copy multiple image files to a page

SO I would have a nice page full of pictures that can easily descrive where they go thta can be clicked to reach each project.

I hope this helps but i don't think all this description will do much to help find a way to do it because there probably thousands of other reasons why someone might want to "copy a file as an image" instead of just copying a file-name or path to a document.   Think Signatures, photo albums, catalogs, etc.  And it is VERY easy to do by hand one at  time. 
But this is MY reason for wanting it and why i want to be able to script it rather than doing a one-up by hand

4wd:
Adding images with hyperlinks can be done using Powershell but not having Word I can't try it.

Something along the lines of:

--- Code: PowerShell ---#Create Word Document $word = New-Object -ComObject word.application$word.visible = $false$doc = $word.documents.add()$selection = $word.selection$selectimage =   $selection.InlineShapes.AddPicture(C:\dir1\invite.png)$doc.Hyperlinks.Add($selectimage.Range,'http://www.project1.com')$selectimage =   $selection.InlineShapes.AddPicture(C:\dir2\invite.png)$doc.Hyperlinks.Add($selectimage.Range,'http://www.project2.com')$selection.TypeParagraph()$selectimage =   $selection.InlineShapes.AddPicture(C:\dir3\invite.png)$doc.Hyperlinks.Add($selectimage.Range,'http://www.project3.com')$selectimage =   $selection.InlineShapes.AddPicture(C:\dir4\invite.png)$doc.Hyperlinks.Add($selectimage.Range,'http://www.project4.com') $doc.saveas([ref] "C:\document", [ref]$saveFormat::wdFormatDocument)$word.quit()
With the attendant code to read from a list of invite.png file paths, the associated URLs, and repeating as necessary until the list is exhausted.

questorfla:
4WD, I have to apologize.

 I can see I am just not making my requests difficult enough :(
:)Next time I will see if I can ask fot the world AND the stars !! :up:Would you believe that I had people on Stack-Overflow asking me what I meant by a "Word Document"!
If you do have anything at all that can hold images and want to test, That is all I really need.  Unless :tellme: it is for a MAC!
I just wanted to give them a picture sheet as most of these people apparently can't read anyway but even if they could some of the titles are less than obvious.
Msufaosdeanofp would be an example of a folder-name.  I can see where a picture might help there.   :thmbsup:
ps: msufaosdeanofp could be shortened to msufaosdop also depends on my mood that day..

Last request (for the day!)  If you have ever seen CopyQ can you tell me why it doesn't work  I don't have anything but Windows 10 and maybe it isn't compatible  I have a lot of thngs that command would work nicely with

4wd:
Of course there may be simpler ways than playing around with Powershell, ie. write the output as a HTML doc then load into Word and save as a Word file.

eg. Simple HTML output from a command file, etc.

--- Code: HTML5 ---<html><title>Index</title><body><table><tbody><tr><td><a href="https://www.donationcoder.com"><img src="./test/dir1/invite.jpg" alt="Department of software"></a><td><a href="https://www.donationcoder.com"><img src="./test/dir2/invite.jpg" alt="Mouser lives here"></a></tr><tr><td><a href="https://www.donationcoder.com"><img src="./test/dir3/invite.jpg" alt="WTF"></a><td><a href="https://www.donationcoder.com"><img src="./test/dir4/invite.jpg" alt="The end"></a></tr></tbody></table></body></html>
You could also add the height and width attributes to the <img> tag to display them the right size to fit the page.

questorfla:

I just got home and was about to try your first one with WORD.
The 2nd looks very much like the script that i came up with to create the HTML "photo album" which is what it was meant to do.  And I agree that it works fine.  HTML is actually a better format for what i need and going forward, it will work a charm.
But.  I have to make the FIRST one    one by one    for 76 sites.  OR  figure out why it won't script.

Right now working from a folder copy of all the invitation images plus text files loaded with the url for each invitation, i am still having the Dickens of a time getting the value of the invitation.TXT (which is storing the actual URL) to be read into the script variable to for loading the a^href section of the line.

The original code I am working with is PHP and being as how I know "Nothing" abut PHP maybe i picked a bad starting point.  But it did so well with the CSS display characteristics i hated to give it up.  It reads every png file perfectly and puts the image right where it should.  But the code loads the png's actual "local drive" location to the a^href value.  I will try to attach it here in a sec and maybe you ca see where I am "blind"

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version