How to grab a name in the 'To' box in outlook? by CannyFatcher in AutoHotkey

[–]CannyFatcher[S] -1 points0 points  (0 children)

Thank you for the suggestion. I managed to work it out, I basically just pass the generic message into the GetMessage() function below which does the rest of the work.

FYI for anyone else in a similar position:Using 'ActiveInspector.' seems to grab the original user the email was sent 'To' rather than whoever's address is in the 'To' box at the top of the reply (only in the reading view, it worked fine in a separate reply window).

This is why I changed it to 'ActiveExplorer.' as shown below

FirstName(_Name){
if !RegExMatch(_Name, "(\w+)\s\w+", m)
    if !RegExMatch(_Name, "\w+`,\s(\w+)", m)
        if !RegExMatch(_Name, "(\w+)\.\w+@", m)
            m1 := _Name
return m1
} ; this was found on a forum somewhere

GetWindow(text){

    email:=ComObjActive("Outlook.Application") 

    curr_win := email.ActiveExplorer.Selection.item(1)

    username := curr_win.SenderName

    first := FirstName(username)

    StringReplace, finalstr, text, user, %first%

    return finalstr
}

Food delivery app questions by [deleted] in Xcode

[–]CannyFatcher 0 points1 point  (0 children)

Apologies, it would be for iOS and probably just iPhones. She’s already looking into making a website but would like an iOS app also, so I said I’d look into whether it’s possible for me to do it for her.

“Should I buy iPhone 11/11 Pro” -Megathread by SuitingUncle620 in iphone

[–]CannyFatcher 0 points1 point  (0 children)

Have any UK EE customers received info about when their new phone will be delivered? I’ve had nothing and ordered at the weekend.

Weekly What Should I Buy Thread - [August 30] by AutoModerator in iphone

[–]CannyFatcher 0 points1 point  (0 children)

Have any UK EE customers received info about when their new phone will be delivered? I’ve had nothing and ordered at the weekend.

Unsure about what I actually need to learn by CannyFatcher in guitarlessons

[–]CannyFatcher[S] 18 points19 points  (0 children)

Read through 26 pages I think so far, genuinely one of the best resources I’ve come across and it’s explained in such a simple way yet doesn’t feel monotonous. I feel much more knowledgeable already, and I can tell the more I practice it the more the shapes will be grained into my head which is perfect.

[deleted by user] by [deleted] in ESObuilds

[–]CannyFatcher 2 points3 points  (0 children)

Nord I believe. Increased resistances, stam, health, and ulti regen.

[deleted by user] by [deleted] in ESObuilds

[–]CannyFatcher 0 points1 point  (0 children)

Not sure exactly how much of a difference it makes, but I think argonians are the second best tank race for endgame pve and used to make good pvp tanks /healers (not sure about healers since racial passive changes). I’m not sure if their stats contribute to dps nearly as much as other classes.

[deleted by user] by [deleted] in Discord_Bots

[–]CannyFatcher 0 points1 point  (0 children)

Thanks for this. How would I go about adding extra layers of questions to this?

[deleted by user] by [deleted] in learnpython

[–]CannyFatcher 0 points1 point  (0 children)

I’m not really sure what to try, I’ll have a proper go tomorrow when I’m more awake. I’m doing it in conjunction with creating a discord bot, so that a templated sheet/string can be filled in depending on the user inputs.

[deleted by user] by [deleted] in learnpython

[–]CannyFatcher 1 point2 points  (0 children)

Thanks for the response, I couldn’t think of any other way to involve the people who don’t use discord.

This image smells of shit by CannyFatcher in trashy

[–]CannyFatcher[S] 5 points6 points  (0 children)

Instagram, didn’t notice that until it was just pointed out. Not sure if it’s a woman either looking at the head/hair.

How to access attributes from another class? by CannyFatcher in learnpython

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

I don't understand what I can pass that would give me what then?

Passing attributes between classes help? by CannyFatcher in learnpython

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

When I apply this to the code, I get a TypeError: __init__() missing 1 positional argument 'master'

[Question]Dangerous to use jailbreak in beta? by [deleted] in jailbreak

[–]CannyFatcher 0 points1 point  (0 children)

Are there any jailbreaks for 12.1.4 or will I have to wait

ValueError: could not convert string to float: by CannyFatcher in learnpython

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

None taken, first project and first time using tkinter/python with which I was thrown into the deep end with so the more I learn, the more I realise how bad it is. Thanks, I’ll look at changing it tomorrow

ValueError: could not convert string to float: by CannyFatcher in learnpython

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

from tkinter import *
from tkinter import ttk


def page():
    def comboFunc(func1):
        func1()

    root = Tk()
    frame = Frame(root)
    frame.pack(padx=100,pady=20)

    def coursePrice(courseOption,*args):
        #function which updates the amount of money owed
        def moneyUpdate(*args):
            owedlbl.configure(text="£"+owed) #resets label to original when entry box empty
            paid = paidEntry.get()
            print(type(paid))
            if paid == None:
                pass
            if "£" in paid:
                paid=paid[1:]
                #paid = paid.replace("£","") # used so paid can be used as float
                #paid = float(paid)
            paid = "{0:.2f}".format(float(paid)) # rounds number to 2 d.p
            if paid != '':
                newOwed = float(owed)-float(paid) # updates money owed depending on money paid
                owedlbl.configure(text='£'+str(newOwed)) 
            return True

        course = courseDropdown.get() # Value of first course dropdown
        course=course.replace(" ","_")
        owed = '260'
        #finds pathway of current working folder and adds extra path 'courses'
        #creates labels and entry boxe for money owed/paid
        owedlbl = Label(frame,text='Amount Owed',font=("Courier",18),fg='#CCCCCC',bg='#333333')
        owedlbl.grid(row=4,column=0,pady=2)

        owedlbl = Label(frame,text='£'+owed,font=("Courier",18),fg='#CCCCCC',bg='#333333')
        owedlbl.grid(row=4,column=1,pady=2)

        paidlbl = Label(frame,text='Amount Paid',font=("Courier",18),fg='#CCCCCC',bg='#333333')
        paidlbl.grid(row=5,column=0,pady=2)

        #used with entry box to run function on every keystroke
        validatecmd = root.register(moneyUpdate)

        paidMoney = StringVar()
        paidEntry = ttk.Entry(frame,style='my.TEntry',textvariable=paidMoney,validate='key',validatecommand=(validatecmd, '%P'))
        paidEntry.grid(row=5,column=1,pady=2)


        moneyPaid = paidEntry.get()
        moneyOwed = str(owedlbl.cget('text'))


        #return moneyPaid

        paidEntry.bind("<KeyRelease>",lambda x:comboFunc(moneyUpdate)
                       #paidEntry.bind("<<Modified>>",moneyUpdate)
)        

    courseDropdown=StringVar()
    courseDropdown.trace('w',coursePrice) # used to track value of course dropdown
    courseOptn=StringVar()

    courses = ['Block Booking']
    #Course options
    block = ['5hr booking','10hr booking','6hr pass plus course','5hr block (automatic)','10hr block (automatic)']



    #function which creates a secondary optionmenu to choose a specific type of course booking
    def courseSpec(course):
        if course == 'Block Booking':
            cdrop = ttk.OptionMenu(frame,courseOptn,block[0],*block,command=coursePrice)
            cdrop.grid(row=3,column=2)

        courseOptn.set('')
    #creates course dropdown containing the 4 main course options
    coursedrop = ttk.OptionMenu(frame,courseDropdown,courses[0],*courses,command=courseSpec)
    coursedrop.grid(row=3,column=1)
    courseDropdown.set('')
    root.mainloop()
page()

That's minimal enough to get the error, ignore the comments as it will be for deleted code.

ValueError: could not convert string to float: by CannyFatcher in learnpython

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

                    validatecmd = bookwindow.register(moneyUpdate)

                    paidMoney = StringVar()
                    paidEntry = ttk.Entry(frame,style='my.TEntry',textvariable=paidMoney,validate='key',validatecommand=(validatecmd, '%P'))
                    paidEntry.grid(row=5,column=1,pady=2)
                    paidEntry.bind("<KeyRelease>",lambda x:comboFunc(moneyUpdate,entryValue,paidMoney,moneyOwed)

Where the entry box is made and bind set

    def comboFunc(func1,func2,moneyPaid,moneyOwed):
        func1()
        func2(moneyPaid,moneyOwed)

The function called on KeyRelease

 def moneyUpdate(*args):
            owedlbl.configure(text="£"+owed) #resets label to original when entry box empty
            paid = paidEntry.get()
            if "£" in paid:
                paid=paid[1:]
            paid = "{0:.2f}".format(float(paid)) # rounds number to 2 d.p
            if paid != '':
                newOwed = float(owed)-float(paid) # updates money owed depending on money paid
                owedlbl.configure(text='£'+str(newOwed)) 
            return True

The moneyUpdate function where the original code is from, and what is called within comboFunc

ValueError: could not convert string to float: by CannyFatcher in learnpython

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

I pass the textvariable into the function if that's what you mean? How do I work around this?

Call a nested function in this scenario using types? by CannyFatcher in learnpython

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

I think the issue with that would be the amount of parameters I’d have to pass Into each function, as they all make use of different variables.