AutoHotkey Community

It is currently May 24th, 2012, 2:02 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Be python.
PostPosted: November 14th, 2008, 2:47 am 
Have an option to create an extention for single-file python AND ahk, where lines intersperse with each other: some are python, some are ahk.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2008, 10:24 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
You serious lol?

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2009, 8:26 pm 
Offline

Joined: September 28th, 2004, 7:10 am
Posts: 17
As presented I don't really like the idea, but I have many times wished that I had AHK's functions exported to a DLL where I could call them from another scripting language.

I routinely work in about five or six scripting languages for various tasks, and I frequently end up using features from other scripting languages. It would be very cool if I could call some subset of the root AHK functions from another scripting language.

I currently implement a sort of hack in most languages where I define a snippet of AHK code as a string, write it to a temp file and execute that temp file. For example, in the Visual SlickEdit Script Language I use for industrial strength text processing, I have a function:
Code:
_command void AhkRun(...) name_info(',') {
   _str Code[];
   int ArgIx;
   for (ArgIx = 1; ArgIx <= arg(); ArgIx++)
      ArrayAppend(Code, arg(ArgIx));

   FileWriteLines('C:\Temp\Work.ahk'
                  , '#SingleInstance force'
                  , '#include C:\AutoHotkey\AHKLib.ahk'
                  , ''
                  , Code
                  , '   ExitApp'
                  , '');
   execute('AutoHotkey.exe', 'C:\Temp\Work.ahk');
}


That basically takes a parameter array of AHK statements, generates a temp file and executes it. It would be so much nicer if I could just call the functions directly. I have similar functions for Python, 4NT and PowerShell. If I had an AutoHotkey.dll with a collection of exported functions, I'd use it all the time from other tools.

I've considered taking the source code and making it myself, but never quite got around to it.

I also think it would be excellent if I could leverage the HOTKEY and HOTSTRING functionality in another language. For example, I can define a lot of hotkeys in WinWord, but not in Excel. If I could call HOTKEY from VBA, I'd use it to customize Excel. I currently do something like that by having a whole bunch of #IfWinActive statements in an AHK script I have running 100% of the time, but it's hard to get good granularity that way. I've considered making a sort of AHK Server to do the job using messaging which would be relatively easy, but it's a bit of a hack.

I like AHK and use it all day every day, but it would be nice if I could use pieces of it from other languages without jumping through hoops.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto and 20 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