PDA

View Full Version : Any Takers?


whitrhino
06-11-2009, 05:49 AM
First off, i am new here and thanks for everything so far guys! You have already helped me to figure this stuff out rather quickly. Please take it easy on me as this is my first post. I will try to be as clear as possible.

I have been working more hours than i want to count trying to figure out a way to import pictures found on a certain website into my app using iexplorer plugin.

Here Goes...

1. program starts and searches a folder for *.extention.
2. program adds found items to to listbox minus the file extention
3. user selects a title from the listbox and the web object displays the results
4. user finds exact picture of choice, then clicks it
5. (the problem) program gets selected

How do i get iexplorer plugin to find out which image was clicked and return the url directly to the image for download?
I have been thinking of maybe getting source from iexplorer plugin and searching the string for .jpg extention and somehow guessing how many chars make up the entire url to the image? idk im clueless.

6. program downloads image and saves it as filename selected in listbox data (full file path) field with the .jpg extention (EXAMPLE: Filename.ext.jpg)

This App is nearly complete, however i am stuck on step 5 the rest is pretty ready to be debugged. i started using this software a short time ago and i have no scripting or coding experiance. this is all new to me. i have already made a nearly complete portable media center using ams and this is the final addition to it! Thanks in advance for any help!

if you need any additional info, let me know and i will post it.

MicroByte
06-11-2009, 06:40 AM
both the web object and IExplorer plugin have a "On Navigate" event which sends the variable "e_URL" to the event, so when a user clicks a image link you simply check the url to see if its one of your images and if so save it to the local disk and reload the original page

there have been a few examples in the past of using a web object to interact with various parts of AMS, by checking the url you can respond to any user clicks and and perform actions based on the url.

i dont have time to make a example right now, but im sure as you got this far with very little help you'll soon be on your way

TIP: use "String.Splitpath" to split the url path and check the extension for "jpg"

whitrhino
06-15-2009, 01:58 PM
thanks! i will deff. give that a try asap.. i have been lil busy with work and will post results when i have them... btw, i already have use of splitstring in my script, although i must admit that i dont fully understand how to use it, though it seems usefull :P

ShadowUK
06-16-2009, 12:35 AM
Since I can't help much, I'll just tell you how to use SplitString.

For example, let's say that we have a variable called 'x' and it contains a file path.

local x = "C:\\File.ext";

Now we can split the string from that path.

local split = String.SplitPath(x);

Now it's been split, We can access one of the variables that have been stored in the table.

local Extension = split.Extension;
local Filename = split.Filename;

Now you can do stuff with it.

ListBox.AddItem("ListBox1", Filename, x); -- No extension here, Will show "File" in the ListBox.
ListBox.AddItem("ListBox1", Filename..Extension, x); -- Extension given, Now shows "File.ext" in the ListBox.

Hope that helps a bit.

whitrhino
06-16-2009, 10:39 AM
As i thought, it is very usefull then. =P i will deff use this in the future, now that i have a better understanding on how it works. Thanks ShadowUK!