Giter Site home page Giter Site logo

autohotkey-util's People

Contributors

cocobelgica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autohotkey-util's Issues

BrowserEmulation (FixIE) Minor Issues

Hey @cocobelgica
Got this from the old thread.
The 6432Node bit doesn't apply- see this and the following answer- + cannot jump out of finally block any more.
Here's a modded version of it that addresses just those (sorry- fixated on FixIE as everyone else seemed to be):
Edit: also modded the "version := Round..." line where, previously, existing reg entries greater than 1000 would be multiplied by 1000 again.

``

``FixIE(version:="*") ;// FEATURE_BROWSER_EMULATION -> http://goo.gl/V01Frx
{
static key := "HKCU\Software\"
. "Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\"
. ( A_IsCompiled ? A_ScriptName : StrGet(DllCall("Shlwapi\PathFindFileName", "Str", A_AhkPath)) )

static WshShell := ComObjCreate("WScript.Shell")

static prev := "*"
if (prev == "*") ;// init
	try prev := WshShell.RegRead(key)
	catch ;// value does not exist
		prev := ""

;// __Get()
if (version == "*")
{
	try val := WshShell.RegRead(key)
	catch ;// value does not exist
	{
		val := "" ;// throw Exception()??
	}
		return val
}

;// __Set()
ie_version := Round(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Internet Explorer\svcVersion"))
if (ie_version < 8) ;// unsure of this but I read it somewhere...
	throw Exception("FEATURE_BROWSER_EMULATION is only available for IE8 and later.")

if version
{
	if !(version ~= "i)^7|-?(8|9|1[01])|edge$")
		throw Exception(Format("Invalid argument: '{1}'", version))
	if (version = "edge")
		version := ie_version
	version := Round(version * (version>0 ? ((version>=1000)? 1 : 1000) : -(version>=-9 ? 1111 : 1000.1)))
}

try version? WshShell.RegWrite(key, version, "REG_DWORD")
           : (prev != "" ? WshShell.RegWrite(key, prev, "REG_DWORD") : WshShell.RegDelete(key))
catch error
{
	throw error
}
	return FixIE() ;// OR return the value itself
}

Thanks.

Subprocess.ahk's StreamReader needs AtEndOfStream

In WScript.Shell.Exec, some streams need some time to finish reading, so we poll AtEndOfStream and collate the ReadAll

In Subprocess.ahk's case it's the opposite. Doing a drop in replacement results in a script polling this nonexistent property (which returns a falsy value) and so it is stuck in a polling loop thinking EOF is far far away.

And yeah, I can write my code around it but it'd be a nice thing to have to facilitate a drop-in replacement.
edit: scratch that, this is an important property that should be exposed on the same level as the Read method.

Namespacing!

This is an awesome collection - any chance you name them?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.