I need a way to have an app fill text fields in firefox
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I need a way to have an app fill text fields in firefox
At work, I use proprietary web based software to log and track data from purchasing to warehouse management. I am not in a position to modify that software in any way and do not have access to the source code. I now find myself in need of an app that will make my job more efficient. Part of my job is to import purchase orders in pdf format into the company software. This involves typing the 14 digit PO number taken from the PDF document name into the company search engine. With as many as 300 POs a day this gets tedious. So, my thought is to create an app that will look into the folder holding the POs, list them in a text field and turn them into clickable links. when clicked the app would send the file name, (PO number) to the search field of the web browser (firefox). I have had no problem with getting a directory's contents, creating the links, extracting the file name to a variable, and saving that variable to the clipboard. I am however stumped as to how to put focus back to firefox and paste the data. Any ideas?
Re: I need a way to have an app fill text fields in firefox
Yeahoooo this is fun!
Man... make your life so easy (err I mean productive)
You are probably going to have to write a vb script on the fly then run it.
Easy don't worry!
Wow, all wrapped up with a bow! Merry Christmas
err this is for Windows
I should have been able to run that without writing it to a file but it wasn't working for me.
Now you just have to figure out how to get the PO# into that script
Simon
Edit:
This script is more along the lines of a working environment (eg you already have firefox open)
Man... make your life so easy (err I mean productive)

You are probably going to have to write a vb script on the fly then run it.
Easy don't worry!
Code: Select all
on mouseUp
set the defaultFolder to specialFolderPath("desktop")
put "Set WshShell = WScript.CreateObject(""e&"WScript.Shell""e&")" & cr & \
"WshShell.Run ""e&"firefox.exe""e&"" & cr & \
"WshShell.AppActivate ""e&"Firefox""e&"" & cr & \
"Wscript.Sleep 3000 'wait 3 seconds" & cr & \
"WshShell.SendKeys ""e&"Type my PO now""e&"" & cr & \
"WshShell.SendKeys ""e&"{ENTER}""e&"" & cr & \
"WScript.Quit" into tScript
put tScript into url "file:magice.vbs"
launch document "magice.vbs"
wait 50 millisecs
delete file "magice.vbs"
end mouseUp

err this is for Windows
I should have been able to run that without writing it to a file but it wasn't working for me.
Now you just have to figure out how to get the PO# into that script

Simon
Edit:
This script is more along the lines of a working environment (eg you already have firefox open)
Code: Select all
on mouseUp
set the defaultFolder to specialFolderPath("desktop")
put "Set WshShell = WScript.CreateObject(""e&"WScript.Shell""e&")" & cr & \
"WshShell.AppActivate ""e&"Firefox""e&"" & cr & \
"Wscript.Sleep 1000 'wait 1 seconds" & cr & \
"WshShell.SendKeys ""e&"{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}{bs}""e&"" & cr & \
"WshShell.SendKeys ""e&"Type my PO now""e&"" & cr & \
"WshShell.SendKeys ""e&"{ENTER}""e&"" & cr & \
"WScript.Quit" into tScript
put tScript into url "file:magice.vbs"
wait 50 millisecs
launch document "magice.vbs"
wait 1 sec
delete file "magice.vbs"
end mouseUp
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: I need a way to have an app fill text fields in firefox
Thank you Simon, I will play with this tonight and see how it works. Hopefully this will cut my 60 hour work weeks down to a bit.
Re: I need a way to have an app fill text fields in firefox
Not that I'm being a coward, but the vb script I wrote is specific to the currently selected field on firefox (if you were just to click the titlebar which field would be selected?). But I think you can use tab {tab} to move between the fields to get to the one you want using vb script....(PO number) to the search field of the web browser (firefox)
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: I need a way to have an app fill text fields in firefox
Does the vendor of that web app have an API? APIs are increasingly popular with web services because they not only allow more efficient use by clients like yourself, but can also reduce server load for them when compared to handling the same requests via individual web pages.magice wrote:At work, I use proprietary web based software to log and track data from purchasing to warehouse management. I am not in a position to modify that software in any way and do not have access to the source code. I now find myself in need of an app that will make my job more efficient. Part of my job is to import purchase orders in pdf format into the company software. This involves typing the 14 digit PO number taken from the PDF document name into the company search engine.
If they don't yet have an API it may simply because they haven't thought about the benefits for their business in making one. Possibly a very good conversation to have with them, and once they do have an API you should be able to POST data to it easily with LiveCode, much more efficiently than emulating keystrokes.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: I need a way to have an app fill text fields in firefox
Simon,
That works exactly as I needed. (I did however change those horrible wait commands with send in time). Thank you
FourthWorld
Unfortunately it was all written by a employee that is no longer there. The software was never approved by the company executives and remains an inter-company political volcano on the verge of eruption. There is no API. If I change the software in any way, the executives are shown to be right, and my entire department gets "reorganized". My boss has to prove that it is working flawlessly in order to keep her job, meanwhile I am forced to work with the least efficient and most amateur interface conceivable, and act like it is perfect in order to keep my job. So, my answer is to create a few "Desktop tools" to augment the efficiency.
That works exactly as I needed. (I did however change those horrible wait commands with send in time). Thank you
FourthWorld
Unfortunately it was all written by a employee that is no longer there. The software was never approved by the company executives and remains an inter-company political volcano on the verge of eruption. There is no API. If I change the software in any way, the executives are shown to be right, and my entire department gets "reorganized". My boss has to prove that it is working flawlessly in order to keep her job, meanwhile I am forced to work with the least efficient and most amateur interface conceivable, and act like it is perfect in order to keep my job. So, my answer is to create a few "Desktop tools" to augment the efficiency.
Re: I need a way to have an app fill text fields in firefox
Great News magice!
Happy Holidays
Simon
Happy Holidays

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: I need a way to have an app fill text fields in firefox
You are a brave soul to hang out in a situation like that. God speed, my friend.magice wrote:Unfortunately it was all written by a employee that is no longer there. The software was never approved by the company executives and remains an inter-company political volcano on the verge of eruption. There is no API. If I change the software in any way, the executives are shown to be right, and my entire department gets "reorganized". My boss has to prove that it is working flawlessly in order to keep her job, meanwhile I am forced to work with the least efficient and most amateur interface conceivable, and act like it is perfect in order to keep my job. So, my answer is to create a few "Desktop tools" to augment the efficiency.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn