dilligence

Would like a script for launching a website via symbolic link on my desktop

6 posts in this topic

#1 ·  Posted

Hello everyone,

I could use some help with the following: 
I'm a speech recognition user and recently I've started to use AutoIt for additional scripting because sometimes it works faster. 
I would like to create an AutoIt script that will open the Chrome link on my desktop which is a a symbolic link, so that the Chrome cache is on my Ram drive:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disk-cache-dir="A:\Browser Cache"

Next I want to send the website address, in this case: https://autochords.com/ (with SendKeys) to the address bar.
Then another SendKeys to send Enter.

I want to use this script when I'm working on my girlfriend's computer, where speech recognition isn't installed.

I could use ShellExecute ("Chrome", "https://autochords.com/") but then it won't run via my ram drive.

I am a Dragon NaturallySpeaking user. The program has a scripting language similar to VBA. In Dragon the command is as follows:

HeardWord "open","chrome" ; HeardWord acts as if I literally said "open Chrome" this command opens any desktop shortcut no matter which window I'm working in.
Wait 1500 
SendKeys "https://autochords.com/"
SendKeys "{Enter}"; these last three lines are similar to AutoIt language I think.....

Any help would be appreciated.

Rob


 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Use the Run command instead of ShellExecute. You can pass it the exact command you showed above.

There's also a Chrome UDF, which may be able to meet your needs.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Okay I will test that.

Edited by dilligence
Didn't test it properly

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I got it to work, at least the launching of the Chrome Ink. The SendKeys part is not a problem I can insert that later.

Run(@ComSpec & ' /c "Chrome.lnk"', @DesktopDir, @SW_HIDE)

 

Edited by dilligence
Needed to test some more

Share this post


Link to post
Share on other sites

#5 ·  Posted

The next line will start Chrome from a link on the Win 10 desktop,

 go to the wanted web address ,

use the parameters needed

(without using  wait or send ):

ShellExecute(@DesktopDir & "\chrome.lnk", "https://autochords.com" & ' --disk-cache-dir="A:\Browser Cache"',"","")

For extra information check the AutoIt help file.

Share this post


Link to post
Share on other sites

#6 ·  Posted

That works even better. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • zuliasro
      By zuliasro
      Hi,
      Please help me I haven't a big experience with AutoIt and JS.
      I develop a macro in AutoIt which open a Chrome browser, navigate between websites clicking no some links, insert data to forms, etc...
      Now I can't click on an element:
      <a class="mr-link js-click-link" style="font-size:16px; line-height:21px;"><u>Click now</u></a> Please pointing me how it's possible. 
      Thank you
    • zuliasro
      By zuliasro
      Hi,
      Please help me I haven't a big experience with AutoIt and JS.
      I develop a macro in AutoIt which open a Chrome browser, navigate between websites clicking no some links, insert data to forms, etc...
      Now I can't click on an element:
       
      <a class="mr-link js-captcha-link" style="font-size:16px; line-height:21px;"><u>Введите код с картинки</u></a> Please pointing me how it's possible. 
      Thank you
    • billshu
      By billshu
      Is there any way to change chrome settings from Auto-it.  I would like to change back and forth, between "Allow Site to show POP-ups" and "Do not Allow Site to show POP-up"?
    • ZeroByDevide
      By ZeroByDevide
      I got some code from internet and i wanted to open a incongito browser and search my website but i cant seem to open google chrome in the incongito mode.
      whenever i click to run my code it opens a tab in normal google chrome.
      heres my code now:
       ShellExecute("chrome.exe", "http://www.erikzandstra.nl", "--incongito")
    • Rhazz
      By Rhazz
      Hi, I'm trying to upload a file with a web browser but I can't select the Open File window to select the file that I want to upload.
      TL;DR I can't handle the Open File window of Chrome and MS Edge. AutoIt just doesn't find it by its title (in Firefox yes, but not on Chrome and MS Edge).
      With another software (Selenium Webdriver in Python) I access to a web page with a common HTML5 file uploader and I click on it, but when the Open File window comes up, I want to select a file and press Enter (write the filepath that I give and press Enter key or Open button).
      I have the idea, and I have the script on AutoIt too... but it doesn't work on Windows Edge and Chrome, only works on Firefox and Pale Moon (who are basically the same).
      Here is my code:
      #include <MsgBoxConstants.au3> $title = "Abrir" ; My Windows is in spanish, but I guess it's "Open" in English and it's the same code WinActivate($title) If WinActive($title) Then send("C:\Users\myuser\images\my_image.jpg") Send("{ENTER}") Else MsgBox($MB_SYSTEMMODAL, "WinActive", "Window not found.") EndIf In Firefox (and Pale Moon) the Open File window comes up, the file path is written and the Enter key is pressed. It works perfect.
      In Chrome and Edge, I never see the Open File window on top... and I neither see "Window not found" message (seems like AutoIt finds it but doesn't send keys).
      Edit: before to send this post, I started thinking again and... after several tests, I discovered one thing: when you select the window, in Firefox (and Pale Moon) the cursor goes to the combobox (where I have to put the text) and it's possible to write just after clicking (or opening, what in AutoIt it is "Activate" I guess) the window but in Chrome and Edge it isn't like that, when you click the window, the cursor doesn't go to the combobox.
      With that "discovery", I tried to select the combobox but... I failed again. And now I have no idea how to go ahead.
      #include <MsgBoxConstants.au3> $title = "Abrir" WinActivate($title) If WinActive($title) Then ControlClick($title, "", 1148) ; Still it does not work send("C:\Users\myuser\images\my_image.jpg") Send("{ENTER}") Else MsgBox($MB_SYSTEMMODAL, "WinActive", "Window not found.") EndIf