Jump to content
Sign in to follow this  
Garrik

HOW TO USE A UNIVERSAL COMMAND - (Moved)

Recommended Posts

Hi everyone!

I just have a quick question I just did my first .exe and boy!! It was really complicated!!! Im not sure how but it works haha, in one of the commands I use ctrl+g that stands for ctrl+s to save a file in spanish.

 

So my question is, if my .exe runs in a english speaking computer, will it work? if not how can I use like a universal command in order to save or use like an american keyboard for this "\"

 

like I said it does works is not that is not working Im just asking if there is a "universal" way that in every language we can send ctrl s to save a file eventhough is not in an english windows or office etc etc.

 

Thanks in advance for your answer!

Share this post


Link to post
Share on other sites

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

You could go about distinguishing the OS language with the appropriate macro, or other function.

Or you could tweak the code so it doesn't depend on specific keyboard combinations.

Now this depends a lot on what you're doing.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Btw you can notice doing a Send command is sending what you put inside the send command. (Nothing else ;) )

Send {A} on [EN] computer will send {A} on [ALL] computer. 

 

SO i presume if you have to use send ALT+G to send your ALT+S it is becose your G is not a G but a S. 

 

Does I am false ?


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

It depends on which programs you want to address.
AutoIt comes with UDFs for MS Word, Excel and additional UDFs for Outlook etc. are being provided.
So you could have a global key to call the "Save" command. But not by automating the GUI but calling the builtin API of the application.

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites
46 minutes ago, water said:

So you could have a global key to call the "Save" command. But not by automating the GUI but calling the builtin API of the application.

In the case that he know how to do so 😛 . 

I would recommand an easyer way than that to begin with. ^_^

 

And yeah... @water 's UDF is your best solution.

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
40 minutes ago, caramen said:

I would recommand an easyer way than that to begin with. ^_^

Are you really suggesting that trying to automate the Ribbon with Sends and Mouseclicks is going to be "easyer" than using a UDF in which all of that functionality is built in?!


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

@JLogan3o13 Well from my experience with office[OUTLOOK] yes it is. 

And not exactly to answer you. 

I mean from a beginner level knowledge using an udf is not so easy so yeah sometime it can be more easy to use send cmd. But i am not saying it s more or less reliable.

 

As i said when i edited using send is the easyest way. 

Using water's UDF best way. But need learning and practice ;) 

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Not to derail this topic any further but I would love to see an example of something you're doing in Outlook with Sends and Clicks that is easier than the UDF...


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

Arggg long time ago i did that. Let me try to find the script i ll come here to show you it. 

 

BTW the reason is quite simple. I was using Office shordcuts & Send commands together so yeah it was pretty easy and fast to do. 

 

To give you  a fast exemple you can do : 

CTRL + N To do a new mail 

Some tab to send each fields. 

And then CTRL + ENTER to send you email.

EDIT 2 : OFC that mean you have to execute Outlook before your script unlike Water's UDF. 

 

There is plenty of tips like this but about the reliability,  I will never say somthing else than water's udf is better. 

 

Edit: I can even add you can ControlClick Outlook. And again from my old experience it was working but not on all Controls ;) 

 

You can also notice he does not try to automate only Office. 

3 hours ago, Garrik said:

windows or office etc etc.

 

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

This little script (taken from)

retrieves the application for the active window. You would then be able to call the correct function to save the current document/item.

MsgBox(0, "Switch", "Please switch to MS Word", 10)
Local $Actwin = WinGetHandle("[active]")
Local $PidActwin = WinGetProcess($Actwin)
Local $NamePidActwin = _Findpidname($PidActwin)

MsgBox(0, '', $NamePidActwin)

Func _Findpidname($Pid)
    Local $Processlist = ProcessList()
    For $i = 1 To $Processlist[0][0]
        If $Processlist[$i][1] = $Pid Then Return $Processlist[$i][0]
    Next
EndFunc   ;==>_Findpidname

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Thanks a lot for your quick answers!! Like I said it is already working and I´m saving a notepad, so every time a change is made I save ir sending a ctrl g, but I have another friend that would like to use my .exe, but his Windows is in english so the ctrl g doesnt work at all, (I dont know if it is correct to say that it doesnt exist that command or shortcut) so thats why Im asking an easy way to save like for example alt F4 in english and spanish it closes a window, maybe "ctrl !#" saves in all languages  

Share this post


Link to post
Share on other sites
On 3/12/2019 at 5:56 AM, JLogan3o13 said:

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Moderation Team

Thanks my bad

 

Share this post


Link to post
Share on other sites
On 3/12/2019 at 5:59 AM, careca said:

You could go about distinguishing the OS language with the appropriate macro, or other function.

Or you could tweak the code so it doesn't depend on specific keyboard combinations.

Now this depends a lot on what you're doing.

Plane and simple once the autoit finishes working with notepad I use Send("{CTRLDOWN}g{CTRLUP}"), but the issue is that if I send the .exe to another computer that Windows is in English it wont work becuase ctrl G doesnt do anything

Share this post


Link to post
Share on other sites

Oh man i think i just get your issue. 

Maybe Notpad application dont got the same shordcuts for each country. 

The only thing i am sure 100%  is in english version you dont send CTRL + G but CTRL + S 

So ... about the logic you can just check the operating system language and use the wanted shordcut depending of the language OS

 

Look you can use that : 

@OSLang Returns code denoting OS Language. See Appendix for possible values.
$OSLanguage = @OSLang
If $OSLanguage = (Wanted language) Then

    $MySendString = {LCTRL}&G

Elseif $OSLanguage = (Friend OS lnanguage) Then

    $MySendString = {LCTRL}&S

EndIF

Send (''&$MySendString)

 

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
22 hours ago, caramen said:

Arggg long time ago i did that. Let me try to find the script i ll come here to show you it. 

 

BTW the reason is quite simple. I was using Office shordcuts & Send commands together so yeah it was pretty easy and fast to do. 

 

To give you  a fast exemple you can do : 

CTRL + N To do a new mail 

Some tab to send each fields. 

And then CTRL + ENTER to send you email.

EDIT 2 : OFC that mean you have to execute Outlook before your script unlike Water's UDF. 

 

There is plenty of tips like this but about the reliability,  I will never say somthing else than water's udf is better. 

 

Edit: I can even add you can ControlClick Outlook. And again from my old experience it was working but not on all Controls ;) 

 

You can also notice he does not try to automate only Office. 

 

You are right! thats in inglish but in spanish it is ctrl U for a new "window" or document for example in office, so in every lenguage it is a different letter except for ctrl C and ctrl V that thats copy and past in both languages

Share this post


Link to post
Share on other sites
3 minutes ago, caramen said:

Oh man i think i just get your issue. 

Maybe Notpad application dont got the same shordcuts for each country. 

The only thing i am sure 100%  is in english version you dont send CTRL + G but CTRL + S 

So ... about the logic you can just check the operating system language and use the wanted shordcut depending of the language OS

 

Look you can use that : 

@OSLang Returns code denoting OS Language. See Appendix for possible values.
$OSLanguage = @OSLang
If $OSLanguage = (Wanted language) Then

    $MySendString = {LCTRL}&G

Elseif $OSLanguage = (Friend OS lnanguage) Then

    $MySendString = {LCTRL}&S

EndIF

 

I do understand but in that cas it would change the language of the OS???

Thats a little bit extreame?, dont you think, becuase of the language barriers??

 

Share this post


Link to post
Share on other sites

No this is checking the OS language, but it wont change the language anyway, with this code*.

Try that & adapt to your need then ask with what you did ;)

 

Look to understand it you can try that on both computer ;) : 

$OSLanguage = @OSLang

MsgBox ( 0 , '' , ''&$OSLanguage )

 

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks!! all of you for your answers!!

 

Im not able to change the language of all different OS, so what I did is I close the notepad with Ctrl+F4 and then I send Enter in order to save it, this way it doesnt matter which language it is and I dont need to use either ctrl g or ctrl s.

 

I dont know if it is a bad solution, but at least now I can send my .exe and I know now that it can work in any language so it seems it is good.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...