AutoHotkey Community

It is currently May 27th, 2012, 12:35 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: January 5th, 2010, 11:12 am 
iweb_getDomObj

If i enter this into the address bar:
javascript:var oId = crmForm.ObjectId;alert (oId);

---------------------------
Message from webpage
---------------------------
{A8EB1C99-B9F9-DB11-89FF-00137241178B}
---------------------------
OK
---------------------------

how do i get the {XXXXXC99-B9F9-DB11-89FF-00137241178B}
stored as a var or some usable instance???

I'm losing my mind and it's 2:00am in the morning... help ! ! ! please stop the madness...

ie8 using dom tools and fiddler, this is making me crazy because I know i made the correct decision with ahk, i just am at my wits end... help please

the normal url looks like this:
http://xxcrm.xxcrm.com:xxxx/sfa/conts/edit.aspx?id={xxxxxC99-B9F9-DB11-89FF-00137241178B}

i really want to do this with iweb because it makes practical sense, if not please provide a viable alternative... did I say HELP already ;) i'm laughing as i cry...

xclr8tr

[Title edited. Please write descriptive titles for your topics. ~jaco0646]


Report this post
Top
  
Reply with quote  
PostPosted: January 5th, 2010, 12:03 pm 
Offline

Joined: January 5th, 2010, 10:51 am
Posts: 8
i will try to be more clear.

edit: now that i'm on my second post i can edit, go figure ha ha

i made a valiant attempt to figure out how to get the same var string out of iweb as i can by injecting a js string into the address bar. i can't figure it out, it seems like it would be simple with the iweb_getdomobj(pwb;"xxxxx") but for the life of me i can't get the object... variable... whatever you want to call it today out of the xml or url string or js code etc... maybe i'm just doing it all wrong lol, wouldn't be the first time i've fixed things by doing them wrong ha ha.

i can do it with a simple js injection but didn't want to go there as it is to hackerish for the company that i work with. not sure what they will say when i come up with a solution to a workflow problem that vendors won't address-give up, without big maintenance contracts... "hey we are in a recession... my company is going on 2nd year of no raises even for salaried employees... let alone hourly who have had to face reductions.
Just trying to survive this mess... javascript" means access activex with unsigned scripts etc... thats why i'm trying to stick with the whole iweb com dom thing. can you tell i'm not a coder lol, wannabeeee

xclr8tr


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 6th, 2010, 4:54 am 
Offline

Joined: January 5th, 2010, 10:51 am
Posts: 8
tank jethrow sinkfaze sean

help please


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2010, 5:33 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Does this work?
Code:
COM_Invoke(pwb, "Navigate2", "javascript:var oId = crmForm.ObjectId")
oId := COM_Invoke(pwb, "document.parentWindow.oId")
MsgBox, %oId%

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Com Error Notification
PostPosted: January 7th, 2010, 1:19 am 
Com Error Notification

Function Name: "Navigate2"
ERROR: The COM Object may not be a valid Dispatch Object!
First ensure that COM Library has been initialized through Com_Init().
0

Will Continue?

it does about 4 of these like it's not ready from the com lib or something.

I am in over my head, will gladly ship small amounts of currency regularly if i can get this figured out.

I would just do the javascript: thing but it requires that we lessen security and is a concern.

I'm trying to skip the whole activex problem of calling ie windows and think this is the answer just not sure...

I think i am having trouble switching between the different com dom html js concepts. woulld love to just be doing the iWeb thing with the new iWebbrowser Learner, it looks simple enough once i get past this initial hurdle of storing clsid OR guid in a var.

Still trying other iterations of the iWeb concept, does it have something to do with using the "Code Testing Sandbox" or windows 7 or ie8 or is it just that i'm brain damaged lol

this is what i ran
Code:
COM_Init()
COM_Invoke(pwb, "Navigate2", "javascript:  var oId = crmForm.ObjectId")
oId := COM_Invoke(pwb, "document.parentWindow.oId")
MsgBox, %oId%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 2:07 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
See if this works:
Code:
COM_Init()
pwb := iWeb_GetWin("Window Name Here")
COM_Invoke(pwb, "Navigate2", "javascript:var oId = crmForm.ObjectId")
oId := COM_Invoke(pwb, "document.parentWindow.oId")
MsgBox, %oId%
COM_Release(pwb), COM_Term()

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject: jethrow is da man ! ! !
PostPosted: January 7th, 2010, 4:24 am 
All i did was take out the "window name here" and put "A" and it was good to go

here is the your code:
Code:
COM_Init()
pwb := iWeb_GetWin("Window Name Here")
COM_Invoke(pwb, "Navigate2", "javascript:var oId = crmForm.ObjectId")
oId := COM_Invoke(pwb, "document.parentWindow.oId")
MsgBox, %oId%
COM_Release(pwb), COM_Term()


here is my alteration to your code:
Code:
COM_Init()
pwb := iWeb_GetWin("A") ;active or current ie window
COM_Invoke(pwb, "Navigate2", "javascript:var oId = crmForm.ObjectId")
oId := COM_Invoke(pwb, "document.parentWindow.oId")
MsgBox, %oId%
COM_Release(pwb), COM_Term()


Thanks so much for all your help, last question i guess is do you know the direct translation of this to an iWeb function, if not i will check the iWeb.lib and see if its there.

If it isn't a function already it should be and have your name added to the hall of fame ;)

jethrow is my hero :)
xclr8tr


Report this post
Top
  
Reply with quote  
PostPosted: January 7th, 2010, 4:49 am 
Offline

Joined: January 5th, 2010, 10:51 am
Posts: 8
http://www.autohotkey.com/forum/post-322347.html#322347

This is a link back to my request to get this added to the new AHK Recorder they are working on with iWebbrowser2 Learner as i didn't see it in the iWeb.ahk - (lib)

again jethrow, thanks for all your help
xclr8tr


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 5:22 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
forgive the ignorance but of what relavance is this
there is iweb functions to execute jscript and vbscript as well as retreive global variables

and of what general purpose use is the objectid. Its obscure rarely used and as this is the only use whatsoever i have ever seen for it it wouldnt be a Basic Automation functionality

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 7th, 2010, 7:04 am 
Offline

Joined: January 5th, 2010, 10:51 am
Posts: 8
my objective was to get the UID from the common addresable URL.

The addressable URL is a constant, the UID on the end is not and is generally found in this form {00000000-0000-0000-0000-000000000000}

UID's of this nature are not uncommon as they tie together parent child relationships etc...

They are often found in the world of crm and i'm sure in many other relationship oriented databases.

I was unable find a way to extract the UID from either the url or the ObjectId of the form (probably expressed in many other ways like 'parentid') or in any other way.

If you have a simpler solution for getting this from any url or form by way of a iWeb function i would be happy to hear about it and i'm sure the many that come after me will also.

I tried many of the functions listed in the latest iWeb.ahk and was not able to get this returned as a var that was usable. i admit that i'm new to this and coding is not my normal thing so i could have been doing it wrong.

so if you have a better way then post it or test it in some way otherwise i think i just pissed you off :) lol

Having thought about this more i could probably make some big money in the crm world providing user defined workflow with out requiring addition of script to the server or clientside. Maybe we should just close this whole thing quietly and walk away with the money... (translation: i don't have to pay big money to a "tfosorcim"(read backward... they have spies you know) licensed consultant to make systemic mods for workflow etc... they can be custom made for the user without violating license agreements for said products or modifying the code.)

Thanks for listening lol

xclr8tr


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 8:13 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
xclr8tr wrote:
so if you have a better way then post it or test it in some way otherwise i think i just pissed you off :) lol

tank ... pi$$ed off ... :( ... wouldn't imagine it :wink:

This should work as an all iWeb script:
Code:
iWeb_Init()
pwb := iWeb_GetWin("A") ;active or current ie window
iWeb_execScript(pwb, "var oId = crmForm.ObjectId") ; modified by tank
oId := iWeb_GetVar(pwb, "oId") ; modified by sinkfaze
MsgBox, %oId%
iWeb_Release(pwb)
iWeb_Term()


EDIT - modified based on the next posts by tank & sinkfaze. Good catches guys!

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Last edited by jethrow on January 7th, 2010, 8:21 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 3:24 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
@jethrow
while it doesnt seem to hurt i assume its known that the "Javascript:" protocol is unecesary with execscript
Code:
iWeb_Init()
pwb := iWeb_GetWin("A") ;active or current ie window
iWeb_execScript(pwb, "var oId = crmForm.ObjectId")
oId := iWeb_GetVar("oId")
MsgBox, %oId%
iWeb_Release(pwb)
iWeb_Term()


@xclr8tr
what is this magical crm world you speak so highly of?
where can i learn more so i can make a more informed decision on if such is universaly usefull via an iweb function

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 4:26 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
I can't believe I'm the only one of the three that caught the error in this...

Code:
iWeb_Init()
pwb := iWeb_GetWin("A") ;active or current ie window
iWeb_execScript(pwb, "javascript:var oId = crmForm.ObjectId")
oId := iWeb_GetVar(pwb,"oId")
MsgBox, %oId%
iWeb_Release(pwb)
iWeb_Term()


At any rate, I'm more on board with tank with regards to the objectId. I've used COM and iWeb to work with both CRM and web apps at my place of work and have never once needed to retrieve the objectId for anything; in fact, this is first request I believe I've ever seen in these forums to retrieve the objectId. Short of a massive popularity burst I don't think it needs an iWeb function of its own.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 4:39 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
sinkfaze wrote:
I can't believe I'm the only one of the three that caught the error in this...
ROFL
tank =======big fat idiot great catch Sinkfaze

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 5:04 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
tank wrote:
big fat idiot


That's usually my job. :lol:

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], chaosad, Exabot [Bot], jrav and 24 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