AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with using self-defined environment variable

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
TalksWithComputers



Joined: 16 Aug 2009
Posts: 20

PostPosted: Sat Dec 12, 2009 2:44 pm    Post subject: Problem with using self-defined environment variable Reply with quote

Hi

I need to append e-mail addresses to a file in a directory on several computers.

I have created on all these computers an environment variable called "Magic Briefcase" so I can run the same script on all of them.

But I can't find out how to call the environment variable from within AutoHotkey.

The Variables and Expressions reference only lists existing environment variables like "A_Temp".

Is it possible to get sth like A_Magic_Briefcase? %A_Magic_Briefcase% does not work...

So, here's the code:
Code:
Send ^c ; E-Mail-Adresse auswählen und kopieren
ClipWait ; Warten, bis Zwischenablage voll ist.
EMA := Clipboard

Gui, Add, Edit, x196 y107 w240 h30 , Edit
Gui, Add, Text, x36 y47 w130 h30 , E-Mail-Adresse:
Gui, Add, Text, x196 y47 w230 h30 , %EMA%
Gui, Add, Text, x36 y107 w130 h30 , Bemerkung
Gui, Add, Button, x36 y187 w100 h40 +Checked gOK, OK
Gui, Add, Button, x196 y187 w100 h40 gCancel, Abbrechen
; Generated using SmartGUI Creator 4.0
Gui, Show, w477 h259, Neue E-Mail-Adresse erfassen
Return

Cancel:
GuiClose:
ExitApp

OK:
FileAppend `n%EMA%, C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Magic Briefcase\E-Mail-Adressen.txt ; gilt!!!
;~ FileAppend `n %EMA%, %A_Magic_Briefcase%\Magic Briefcase\E-Mail-Adressen.txt
ExitApp


Your help is appreciated!
Back to top
View user's profile Send private message
reedly
Guest





PostPosted: Sat Dec 12, 2009 2:52 pm    Post subject: Reply with quote

See the help file! EnvGet
Quote:
Retrieves an environment variable.
Back to top
TalksWithComputers



Joined: 16 Aug 2009
Posts: 20

PostPosted: Sat Dec 12, 2009 2:58 pm    Post subject: Reply with quote

Thank you!

I tried that one, but misunderstood it. Now it works perfectly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group