AutoHotkey Community

It is currently May 26th, 2012, 8:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: July 3rd, 2008, 9:50 pm 
Offline

Joined: July 2nd, 2008, 3:00 am
Posts: 29
What I'm trying to do is load certain variables from a web based account access system in to an AHK script putting the variables where they need to go. I am using the following code to attempt to load the xml information:

Code:
xpath_load(xmlin, "https://xxx.yyy.com/main?cmd=display&user_cust_id=%ID%&raw=1")


the %ID% is user defined earlier in the script.

Then I have created a hotkey as follows:

Code:
F6::
{
cust_email := xpath(xml, "/root/cust_email/text()")
GuiControl,, Email2, %cust_email%
}return


However it never appears to load the xml data. Is there extra code I need to have since I'm trying to load the info via HTTPS or is that not the issue at all?

The XML document appears kinda like this:

Code:
  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <root>
  <cust_blacklist>0</cust_blacklist>
  <cust_country>US</cust_country>
  <cust_email>email goes here</cust_email>
  <cust_first_date>03/06/2007 06:36:01 AM</cust_first_date>
  <cust_last_date>07/02/2008</cust_last_date>
  <cust_nickname>nickname</cust_nickname>


What am I doing wrong?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2008, 10:09 pm 
Offline

Joined: February 18th, 2008, 8:26 pm
Posts: 442
Update to the latest version of xpath and try this:

Code:
tmp = %A_Temp%\x
URLDownloadToFile, https://xxx.yyy.com/main?cmd=display&user_cust_id=%ID%&raw=1, %tmp%
FileRead, xml, %tmp%
FileDelete, %tmp%

xpath_load(xml)
Return

F6::
cust_email := xpath(xml, "/root/cust_email/text()")
GuiControl, , Email2, %cust_email%
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2008, 10:21 pm 
Offline

Joined: July 2nd, 2008, 3:00 am
Posts: 29
OMG that was perfect. Genuis I tell you!

Anyway I can put a progress bar n my UI for that download?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2008, 11:44 pm 
Offline

Joined: July 2nd, 2008, 3:00 am
Posts: 29
lol nm I got it. Thank you SO much for that code. You may have gotten me a raise at work!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: kkkddd1, Yahoo [Bot] and 55 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group