Jump to content

Notepad Help


Recommended Posts

I've also made a habit of saving every script that seems interesting to me in a folder called "script bank", it's already grown to be 150+ mb and it's very damn handy to use when creating new scripts because I tend to separate functions that do an intended action into categories, this way I can just do a quick search through the folder, and I'll have a working script in no-time after a few copy and paste maneuvers.

o.0 you should make a mini-app for your categorized functions to reference and help insert into your current projects... kinda like taxonomy for AutoIT functions =D.

EDIT: I think I'm gonna make one for myself. A multi-list GUI to search categories and subcategories of snippets/scripts which references the .au3 and function name (if applicable)

Edited by mechaflash213
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

Thankyou so much for the help.

I am in the middle of adding mre functions to my Hunterpad known as "Traps", in which you type in a group of text, and then when you click on the Release Button, the text you wrote in the Trap Window will be inserted into the text. I have done quite well so far, but the text replaces all of my other text, instead of adding it. Should I use a string, or what do I do?

My Code:

#include <GUIConstants.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
Opt("TrayMenuMode", 1)
$Form1 = GUICreate("Hunterpad", 1112, 561, 147, 112)
$cEdit = GUICtrlCreateEdit("", 0, 32, 1361, 673)
GUICtrlSetData(-1, "")
GUICtrlCreateLabel(StringLen($cEdit),50,10)
$File = GUICtrlCreateMenu("&File")
$New = GUICtrlCreateMenuItem("New", $File)
$MenuItem4 = GUICtrlCreateMenuItem("Save", $File)
$MenuItem5 = GUICtrlCreateMenuItem("Save As...", $File)
$Save = GUICtrlCreateMenuItem("Open", $File)
$MenuItem7 = GUICtrlCreateMenuItem("Print", $File)
$MenuItem6 = GUICtrlCreateMenuItem("Exit", $File)
$MenuItem1 = GUICtrlCreateMenu("&Edit")
$MenuItem8 = GUICtrlCreateMenuItem("Undo  (Press Ctrl-Z)", $MenuItem1)
$MenuItem9 = GUICtrlCreateMenuItem("Redo  (Press Ctrl-Y)", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenu("&Help")
$About = GUICtrlCreateMenuItem("About... (Shuts down Hunterpad)", $MenuItem3)
$HTU = GUICtrlCreateMenuItem("&Help ", $MenuItem3)
$HTML = GUICtrlCreateButton("&Html",20,5)
$Pin1 = GUICtrlCreateButton("Rusty Trap",100,5)
$Release = GUICtrlCreateButton("Release Rusty",160,5)
_GUICtrlStatusBar_Create($cEdit)
GUISetState(@SW_SHOW)
Local $sSaved_Edit = ""
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $HTML
   GUICtrlSetData($cEdit,"<html><head></head><body></body></html>")
  Case $Pin1
   $PinI = InputBox("Rusty Trap", "Have a document Draft, that you do not want to lose, but need to temporarily store? Copy and Paste the Text into here, you can reuse it with the Release Rusty Button!(Use Carefully as it will replace all of your current text")
  Case $New
   GUICtrlSetData($cEdit, "") ; Empty the control
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Release
   GUICtrlSetData($cEdit,$PinI)
  Case $Save
   $FileOpen = FileOpenDialog("", "", "Html Documents(* .html)|Text Documents(*.txt)|All(*.*)")
   $FileRead = FileRead($FileOpen)
   Send($FileRead)
  Case $MenuItem7
   $sPrintFile = "c:image.png"
  Case $HTU
   MsgBox(0, "Help", "Hunterpad is easy to use, and very basic.                                                     ||Change Notes: 1.0 - Hunterpad Released                                             Here are the current Hotkeys: Ctrl-Z - Undo Ctrl-Y - Redo")
  Case $About
   MsgBox(0, "About", "Made by Dasttann_Software Designer_Website Builder_Computer Fanatic>>>>>>>>>>>Hunter Version: 1.0>>>>>>>>>>>>>>")
   Run('Rundll32.exe "' & @SystemDir & 'mshtml.dll",PrintHTML "' & $sPrintFile & '"', @SystemDir)
  Case $MenuItem6
   Exit
   Case $MenuItem4
   ; Get current content of edit control
   $sCurrent_Edit = GUICtrlRead($cEdit)
   ; Has it changed?
   If $sCurrent_Edit <> $sSaved_Edit Then
    ; Get a filename to save to
    $sFile = FileSaveDialog("Save", "C:", "All(*.*)", 16, "untitled")
    ; Open a file overwriting any existing one
    $hFile = FileOpen($sFile, 2)
    ; Write the file with the current data
    FileWrite($hFile, $sCurrent_Edit)
    ; Close the file
    FileClose($hFile)
    ; Store the current content for future comparisons
    $sSaved_Edit = $sCurrent_Edit
   EndIf
  EndSwitch
WEnd

Much Help will be appreciated

:)

Please Help!

;)

Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list]
Link to comment
Share on other sites

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

When you say

but the text replaces all of my other text, instead of adding it.

are you talking about its replacing all of the other text in your GuiCtrlCreateEdit() or in the opened file?
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

$var = GUICtrlRead($cEdit)
GUICtrlSetData($cEdit, $var & @LF & $PinI)

Store what's already in $cEdit to $var, then instead of just emptying $cEdit to insert $PinI, you're appending whats in $PinI to the end of what you already have in $cEdit.

Edited by mechaflash213
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

Helllo Again!

I am trying to make a "Font" Function, but all of my attempts have failed! Here is my code:

;Includes
#include <GUIConstants.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <GuiScrollBars.au3>
#include <GuiEdit.au3>
#include <Misc.au3>
#include <Clipboard.au3>
#NoTrayIcon
Opt("TrayMenuMode", 1)
;Beggining SOund
Beep(32767,100)
Beep(15000,100)
Beep(7500,100)
Beep(5000,100)
Beep(2500,100)
;Gui Creation
$Form1 = GUICreate("Hunterpad", 1112, 561, 147, 112)
$cEdit = GUICtrlCreateEdit("", 0, 32, 1361, 673)
GUICtrlSetData(-1, "")
GUICtrlCreateLabel(StringLen($cEdit),50,10)
$File = GUICtrlCreateMenu("&File")
$New = GUICtrlCreateMenuItem("New", $File)
$MenuItem4 = GUICtrlCreateMenuItem("Save", $File)
$MenuItem5 = GUICtrlCreateMenuItem("Save As...", $File)
$Save = GUICtrlCreateMenuItem("Open", $File)
$MenuItem7 = GUICtrlCreateMenuItem("Print", $File)
$MenuItem6 = GUICtrlCreateMenuItem("Exit", $File)
$MenuItem1 = GUICtrlCreateMenu("&Edit")
$MenuItem8 = GUICtrlCreateMenuItem("Undo  (Press Ctrl-Z)", $MenuItem1)
$MenuItem9 = GUICtrlCreateMenuItem("Redo  (Press Ctrl-Y)", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenu("&Help")
$About = GUICtrlCreateMenuItem("About...", $MenuItem3)
$HTU = GUICtrlCreateMenuItem("&Help ", $MenuItem3)
$HTML = GUICtrlCreateButton("&Html",20,5)
$Pin1 = GUICtrlCreateButton("Rusty Trap",100,5)
$Release = GUICtrlCreateButton("Release Rusty",160,5)
$Find = GUICtrlCreateButton("Find",240,5)
$Find_and_Replace = GUICtrlCreateButton("Find and Replace",280,5)
$Font = GUICtrlCreateButton("Font..",380,5)
$context = GUICtrlCreateContextMenu($cEdit)
$CB = _ClipBoard_Open($cEdit)
$TT = TrayTip("Welcome!", "Hunterpad is Fun and Easy to Use!", 10,1)
$SB = _GUIScrollBars_Init($cEdit)
$SB1 = _GUIScrollBars_EnableScrollBar($cEdit)
_GUICtrlStatusBar_Create($form1)
Break(1)
GUISetState(@SW_SHOW)
Local $sSaved_Edit = ""
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $Find
   _GuiCtrlEdit_Find($cEdit,False)
  Case $Find_and_Replace
   _GuiCtrlEdit_Find($cEdit,True)
  Case $HTML
   _GUICtrlEdit_InsertText($cEdit,"<html><head></head><body></body></html>")
  Case $Pin1
   $PinI = InputBox("Rusty Trap", "Have a small snippet, that you do not want to lose, but need to temporarily store? Copy and Paste the Text into here, you can reuse it with the Release Rusty Button! ")
  ClipPut($Pin1)
  TrayTip("Clipboard","Copied",5)
  Case $New
   GUICtrlSetData($cEdit, "") ; Empty the control
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Release
   $var = GUICtrlRead($cEdit)
GUICtrlSetData($cEdit, $var & @LF & $PinI)
  Case $Release
   GUICtrlSetData($cEdit,$PinI)
  Case $Save
   $FileOpen = FileOpenDialog("", "", "Html Documents(* .html)|Text Documents(*.txt)|All(*.*)")
   $FileRead = FileRead($FileOpen)
   Send($FileRead)
  Case $MenuItem7
   $sPrintFile = "c:image.png"
  Case $HTU
   MsgBox(0, "Help", "Hunterpad is easy to use, and very basic.                                                     ||Change Notes: 1.0 - Hunterpad Released                                             Here are the current Hotkeys: Ctrl-Z - Undo Ctrl-Y - Redo")
  Case $About
   MsgBox(0, "About", "Made by Dasttann_Software Designer_Website Builder_Computer Fanatic>>>>>>>>>>>Hunter Version: 1.0>>>>>>>>>>>>>>")
  Case $MenuItem6
   Exit
   Case $MenuItem4
   ; Get current content of edit control
   $sCurrent_Edit = GUICtrlRead($cEdit)
   ; Has it changed?
   If $sCurrent_Edit <> $sSaved_Edit Then
    ; Get a filename to save to
    $sFile = FileSaveDialog("Save", "C:", "All(*.*)", 16, "untitled")
    ; Open a file overwriting any existing one
    $hFile = FileOpen($sFile, 2)
    ; Write the file with the current data
    FileWrite($hFile, $sCurrent_Edit)
    ; Close the file
    FileClose($hFile)
    ; Store the current content for future comparisons
    $sSaved_Edit = $sCurrent_Edit
   EndIf
   ;######
  Case $Font;#############
   $FS = _ChooseFont();#
  Case $FS;######################
   GUICtrlSetFont($cEdit, $FS);#####
EndSwitch
WEnd
Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list]
Link to comment
Share on other sites

Read the help file, what does _ChooseFont return? Not a string as you have it but an array instead. I've noticed from following your posts passively, that most of your problem(s) can easily be solved if you took that little bit of extra time to read the help file properly, before jumping in feet first. Which was demonstrated here.

$FS = _ChooseFont()
GUICtrlSetFont($cEdit, Default, Default, Default, $FS[2])
Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...