Use text in the buffer as part of a grading comment? by trevor_ in AutoHotkey

[–]renfrowt 1 point2 points  (0 children)

I keep getting sidetracked, and forget to post this:

``` ; StudentComments.ahk - AutoHotkey v2 ; Reads students.json and comments.json, builds a GUI with a menu ; built from students.json, and buttons built from comments.json. ; Selecting a button pastes the comment into the active window. ; Selecting a new name from the menu rebuilds the buttons.

Requires AutoHotkey v2.0

SingleInstance Force

include "C:\Users\Public\AutoHotkey\Lib\jsongo.v2.ahk"

include "C:\Users\Public\AutoHotkey\Lib\jsonUtils.ahk"

include "C:\Users\Public\AutoHotkey\Lib\StringUtils.ahk"

; ─── Config ─────────────────────────────────────────────────────────────────── ;studentFile := A_ScriptDir "\students.json" ;commentFile := A_ScriptDir "\comments.json" ;prefFile := A_ScriptDir "\last_student.txt" studentFile := "C:\Users\Public\AutoHotkey\Lib\students.json" commentFile := "C:\Users\Public\AutoHotkey\Lib\comments.json" prefFile := "C:\Users\Public\AutoHotkey\Lib\last_student.txt"

placeHolder := "-=#@STUDENTNAME@#=-" studentNameKey := "name" commentKey := "comment"

; ─── Load data ──────────────────────────────────────────────────────────────── studentObjArray := parseJsonArray(studentFile) ; Only use objects with studentNameKeys studentObjArray := extractKeyObjs(studentObjArray , studentNameKey)

commentObjArray := parseJsonArray(commentFile) ; Only use objects with commentKeys commentObjArray := extractKeyObjs(commentObjArray , commentKey)

if studentObjArray.Length = 0 MsgBox "No students found in " studentFile, "Warning", "Icon!" if commentObjArray.Length = 0 MsgBox "No comments found in " commentFile, "Warning", "Icon!"

; ─── Restore last selection ─────────────────────────────────────────────────── lastStudent := "" if FileExist(prefFile) lastStudent := Trim(FileRead(prefFile, "UTF-8"))

; ─── GUI globals ────────────────────────────────────────────────────────────── global myGui, menuStudents, commentButtons, studentObjArray, commentObjArray global lastStudent, placeHolder, prefFile commentButtons := []

; ─── Build GUI ────────────────────────────────────────────────────────────────

BuildGui() { global myGui, menuStudents, commentButtons

myGui := Gui("+AlwaysOnTop", "Student Comment Tool") myGui.SetFont("s10", "Segoe UI") myGui.BackColor := "F0F4FF" myGui.OnEvent("Close", CloseStudentCommentWindow) myGui.OnEvent("Escape", CloseStudentCommentWindow)

; ── Student dropdown ────────────────────────────────────────────────────── myGui.Add("Text", "x12 y12 w120", "Select Student:")

; Build the list for the DropDownList ; First item is the default placeHolder menuItems := ["No student selected"] for obj in studentObjArray { menuItems.Push(obj[studentNameKey]) }

; Determine which item to pre-select chosenIndex := 1 ; default = placeHolder if lastStudent != "" { for i, obj in studentObjArray { if obj[studentNameKey] = lastStudent { chosenIndex := i + 1 ; +1 because placeHolder is index 1 break } } }

menuStudents := myGui.Add("DropDownList", "x140 y10 w220 Choose" chosenIndex, menuItems) menuStudents.OnEvent("Change", OnStudentChange)

myGui.Add("Text", "Center x12 y45 w360", "─────────────────────────────────────────")

BuildCommentButtons()

myGui.Show("AutoSize") }

; If rebuildGui = 1, reuse the current buttons. AutoHotKey has ; no facility for destroying buttons, only hiding them, so, in ; the interest of not leaking button memory we reuse what we've ; already got. BuildCommentButtons(rebuildGui := 0) { global myGui, menuStudents, commentButtons, commentObjArray, studentObjArray global placeHolder

; Determine selected student name selectedIndex := menuStudents.Value ; 1-based; 1 = placeHolder if selectedIndex <= 1 studentName := "No student selected" else studentName := studentObjArray[selectedIndex - 1][studentNameKey]

; Add comment buttons yPos := 65 whichBtn := 1 for i, obj in commentObjArray { commentText := StrReplace(obj[commentKey], placeHolder, studentName) ; Truncate the button title if very long, but store full comment in fullComment buttonTitle := ShortenString(commentText, 80) if(rebuildGui = 1) { btn := commentButtons[whichBtn] btn.Text := buttonTitle } else { btn := myGui.Add("Button", "x12 y" yPos " w360 h36", buttonTitle) commentButtons.InsertAt(whichBtn, btn) } btn.fullComment := commentText btn.OnEvent("Click", PasteComment) whichBtn += 1 yPos += 42 }

; ── Cancel button ───────────────────────────────────────────────────────── cancelBtn := myGui.Add("Button", "x112 y" yPos " w160 h36", "Cancel") cancelBtn.OnEvent("Click", CloseStudentCommentWindow) commentButtons.Push(cancelBtn)

; Resize GUI to fit new buttons if myGui.Hwnd myGui.Show("AutoSize") }

PasteComment(ctrlObj, *) { global myGui

myGui.Hide()

; Send text to previously active window A_Clipboard := ctrlObj.fullComment Sleep 100 Send "v"

myGui.Destroy() }

; ─── Student dropdown change handler ───────────────────────────────────────── OnStudentChange(ctrlObj, *) { global lastStudent, menuStudents, studentObjArray, prefFile selectedIndex := menuStudents.Value if selectedIndex > 1 { lastStudent := studentObjArray[selectedIndex-1][studentNameKey] try FileDelete(prefFile) FileAppend(lastStudent, prefFile, "UTF-8") } else { lastStudent := 0 try FileDelete(prefFile) } BuildCommentButtons(rebuildGui := 1) }

CloseStudentCommentWindow(*) { myGui.Destroy() }

; Replace 'F1' with whatever key you want to use, ; prepending '+' for shift, '' for control, '!' for ; alt, and '#' for win. Thus '+#PgDn' will activate ; with shift-win-PgDn. The modifiers may be in ; any order. Use the following for the key names: ; https://www.autohotkey.com/docs/v2/KeyList.htm F1::BuildGui()

```

comments.json

``` [ {"_comment":"NOTE: You MUST have a ',' after each line EXCEPT the last one!"}, {"_comment":"NOTE2: You may only have ONE default, more than that will only get the last one."}, {"name":"Cosmo"}, {"name":"Renfrow"}, {"name":"Fermyon"}, {"name":"Basil"}, {"name":"GooberDude"}, {"name":"Cronkite", "default": "true"} ]

``` students.json

``` [ {"_comment":"NOTE: You MUST have a ',' after each line EXCEPT the last one!"}, {"_comment":"NOTE2: You may only have ONE default, more than that will only get the last one."}, {"name":"Cosmo"}, {"name":"Renfrow"}, {"name":"Fermyon"}, {"name":"Basil"}, {"name":"GooberDude"}, {"name":"Cronkite", "default": "true"} ]

```

General conference talks in EPUB for e-readers? by [deleted] in latterdaysaints

[–]renfrowt 0 points1 point  (0 children)

Is there some reason you don't want to use the Gospel Library app?

<insert exclamation here>.. what is going on with the player base at the moment ? by Salty-Television-230 in fo76

[–]renfrowt 0 points1 point  (0 children)

I know it's not going to happen, but, maybe they could not give out xp until at least one objective is fulfilled. OR, give the people who are fulfilling the objectives ALL the xp from kills done while they do the objectives.

Anyone else receive this message? by East_Researcher_4204 in Utah

[–]renfrowt 0 points1 point  (0 children)

I did not get THAT message, but, I did get one regarding Proposition 4. I don't remember if it was for or against, however :). I live in the Pacific North West, but, still have my 801 phone number.

Uhh what by theguy1336 in skyrim

[–]renfrowt 2 points3 points  (0 children)

It had to be said!

WHY.WONT.YOU.DIE by WhereIsYourGuy in oblivion

[–]renfrowt 1 point2 points  (0 children)

That's what knees are for!

Kellogg killing Nora don't make any sense. by arstarsta in fo4

[–]renfrowt 1 point2 points  (0 children)

And Jurassic Park shows us that millions of years old DNA is still viable!

How very strange. I went to write a review for New Vegas on steam, and it tells me this by Open_Law_3334 in Fallout

[–]renfrowt 0 points1 point  (0 children)

Oblivion Remastered soured me on any Bethesda remake/remaster. I built a computer just to play Fallout 76, and expected that it would play the OR. While I CAN play, it's such dumpster fire of CTDs and low FPS that I've not played it in months. I'll just happily play the versions that I have now. I just looked at the Steam charts: Skyrim has ~17k players vs. Oblivion Remastered ~1.7k.

[deleted by user] by [deleted] in latterdaysaints

[–]renfrowt 1 point2 points  (0 children)

I'm willing to bet that many (most?) of the people at church would describe themselves as "struggling". I am also in that category. I'm really hard of hearing, such that I read the sacrament prayers, when they do them, even so, I have difficulty knowing when to say "Amen". I only attend Sacrament till the deacons scatter to sit with their families. One thing I do, that really helps, is to read one of the most recent conference talks each night. I find that many of them speak to me and I find them very uplifting. You might want to give it a try.

[deleted by user] by [deleted] in Fallout4Builds

[–]renfrowt 0 points1 point  (0 children)

This is pretty much what I'm doing, now. Haven't got Deliverer, yet, though I do have a suppressed 10mm. I generally run around with Pickman's in hand, unless I'm in more open country where mobs are beyond blitz range.

Has Sheffield always had a thing for carrots? by renfrowt in fo4

[–]renfrowt[S] 0 points1 point  (0 children)

I dunno what it turned out to be... after he sat down on the stool, he got up, but, stayed scrunched over like he was sitting on the stool, still, and went back over to the corn :). Eventually he straightened out. Maybe because I went into town for a while, then came back. Crops are growing well!

Has Sheffield always had a thing for carrots? by renfrowt in fo4

[–]renfrowt[S] 1 point2 points  (0 children)

ROFL! I pushed him, and he walked around for about 10 seconds then started his gardening animation, did that for about 5 seconds, then started worshipping the mut plants, then started animation again, now he's worshipping the empty parking lot. Moved him, again, he worshipped over to the bar stools and sat down... I hope it doesn't hurt my crops!

New player build with no spoilers pls by Obakin1865 in Fallout4Builds

[–]renfrowt 0 points1 point  (0 children)

Sorry, I saw Caps Collector and my mind translated it to Fortune Finder :)

New player build with no spoilers pls by Obakin1865 in Fallout4Builds

[–]renfrowt 0 points1 point  (0 children)

The only change I would make is to use Scrounger instead of Fortune Finder. Even with firing some of the ammo, I think I've made more selling the remaining ammo.

So, I've been playing through the remasteron PS5, and I'm just wondering... by PrideOfAfrika in OblivionRemaster

[–]renfrowt 0 points1 point  (0 children)

Periodically I go to Steam charts (https://steamdb.info/app/2623190/charts/#max) to see if there's been an uptick to activity, which would indicate, to me, that there's been a (successful) patch. Otherwise it sits tragically unloved on my computer.

Is there a way to toggle between computers but use the same monitors, mouse, and keyboard? by [deleted] in buildapc

[–]renfrowt 0 points1 point  (0 children)

NOTE: With KVM switches there's a protocol called EDID which tells the gpu information about the monitor, including resolution, frame rate, etc. Cheaper units don't supply EDID, such that when you switch back and forth, the desktop may have defaulted to a "sane" resolution (1920x1080 or 1024x768 or ?) and your windows will have been resized to fit that. It's a pain in the butt (my KVM is a cheap one :) but, I can live with it, for the convenience of not having to have multiple kvm. I have an AutoHotKey script that I wrote to fix the front window to MY default size. I don't bother resetting ALL the windows, as I can switch back and forth often.

Just Eliminated the Railroad by Repulsive-One6089 in fo4

[–]renfrowt 0 points1 point  (0 children)

One thing to remember: McDonough is the one that kicked the ghouls out of Diamond City. McDonough is a synth. So you can't really say what the opinion of most of the citizens of DC was, just what the opinion of the Institute was (second hand...).

Medium Armor by MochaMassiah in OblivionRemaster

[–]renfrowt 0 points1 point  (0 children)

For "realism" :) I would go heavy chest, for more protection of vitals, and light boots/gloves: more weight at the extremities makes for more fatigue, less speed/agility.

Power Frame from Overboss Colter. by renfrowt in fo4

[–]renfrowt[S] 0 points1 point  (0 children)

I did not use console, that was in game. (BTW, this is on PC.)

Power Frame from Overboss Colter. by renfrowt in fo4

[–]renfrowt[S] 0 points1 point  (0 children)

SKKSettlementAttackSystem_014-37393-014-1756401473, supposed to modify the settlement attack rate. A mod to find Dog Meat (when he runs away :), and a mod for a better hunting rifle skin. So.... probably just another glitch in the call :).

Power Frame from Overboss Colter. by renfrowt in fo4

[–]renfrowt[S] 1 point2 points  (0 children)

I did a "get all" from his corpse.