Coder Social home page Coder Social logo

hi5 / tf Goto Github PK

View Code? Open in Web Editor NEW
139.0 21.0 41.0 52 KB

AutoHotkey library for Text files & Variables (strings)

Home Page: https://autohotkey.com/boards/viewtopic.php?f=6&t=576

License: GNU General Public License v2.0

AutoHotkey 100.00%
text-manipulation tail remove-lines regexreplace trim read find reverse-lines split merge

tf's People

Contributors

hi5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tf's Issues

Won't read lines

Hello, great tool and I see much potential for this. I am trying to get it to read lines from a file. But, everytime I run the following code, all I get in the popup box is C:\Users\kyelc\Desktop\ahkscripts\todolist.txt which isn't correct. I have tried hard coded paths like below, relative paths and setting bounds on the ReadLines. What else can I do?

Code:
Lines:=TF_ReadLines("C:\Users\kyelc\Desktop\ahkscripts\todolist.txt")
MsgBox %Lines%

TF_GetData() bug

TF_GetData(byref OW, byref Text, byref FileName) {
  If (text = 0) ; v3.6
  {
    MsgBox, 48, TF Lib Error, % "Read Error:``npossible reason: perhaps you used ! vs ""!"" ?"
Some newbie try to use this lib, but failed.
His text contain only one line: "000000".
I dont know that you mean here, possibly you mean text = "" ?

Error at line 151 in #include file

Error at line 151 in #include file
"C:\Sysinternal\AutoHotkey\Library\TF\tf.ahk"

Line Text:
data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/hi5/TF/blob/master/tf.ahk","user_id":null}}" data-hydro-click-hmac="9bfa7217bce64129a14fd6cd3fec393f409275859f7468c3ec0b29ca2aa0588c"

Error: This line does not contain a recognized action.

The program will exit.

Option to remove all duplicates

Currently TF_RemoveDuplicateLines only removes the additional duplicates, so 1 of the duplicate is always left behind. Could an option be added to remove all instances of the duplicate so none of them show? This would be useful for comparing 2 lists when you only want to see the non-duplicate items.

using TF_ReplaceInLines and pointing it at users AppData folder

In "myfile.xml", I want to replace FALSE with TRUE on Line 1, so I used your library as follows:
TF_ReplaceInLines("!%A_AppData%\Roaming\myfile.xml""1","","False","True")

This does not work for me. The value is not changed.

If I put in the full file address like this:
TF_ReplaceInLines("!C:\Users\USERNAME\Roaming\myfile.xml""1","","False","True") it works.

Is there a way to get this function working with %AppData% or %A_AppData% as I will be distributing this file to my family, and I dont know their USERNAMEs.

Thanks in advance.

Publishing TF as an ahkpm package?

Hi @hi5. I'm wondering if you'd be interested in publishing TF as an ahkpm package?

ahkpm is a package manager built specifically for AutoHotkey libraries.

I've written a guide on how to publish ahkpm packages and it likely wouldn't take much time at all.

The main thing I noticed that you might need to change is to start tagging new versions with the appropriate semantic version number. e.g. git tag 1.3.18.

I'd be happy to open up a PR adding the ahkpm.json file if you're interested.

Not recognizing working directory

I have been working a lot with TF_RemoveBlankLines, TF_RemoveLines and TF_CountLines. While the count seams to recognize the current working directory, the remove functions don't.

Here are a few details of my application:
Script location: %A_ProgramFiles%\program\script.exe
File location: %A_AppData%\program\file.txt
SetWorkingDir, %A_AppData%\program
script has #include TF.ahk built in (v3.4)

When script.exe uses a TF function relying on the working directory, I get mixed results. The CountLines seams to work fine while RemoveBlankLines and RemoveLines seam to fail.

If I force a hard path to the files I have no problem getting the functions to work but that isn't feasible when creating a program for distribution. I need to rely on system variables to locate properly stored files.

If the Script, files and working directory are all in the same folder, I have no problem accessing the files without a hard path. This is not feasible because the script is a program and belongs in ProgramFiles. Since ProgramFiles is a restricted folder, a text file can't be edited in that directory unless the user is logged in as an admin.

I tried to do a work-around by using the apropriate system variable as the path for the file name within the TF function call. This didn't work either because TF functions can't contain variables as a part of a file name or because I have been unable to work out the syntax on it. Either way, the TF functions should be using the WorkingDir anyway.

I tried going into the TF code to determine the problem but I am still learning and it was a bit over my head for now.

Any help for this bug or a work-around would be greatly appreciated.

Thanks.

Lots of functions not working

I don't understand why but functions like TF_LineNumber aren't working, as in, they do absolutely nothing. If I have a sample file with a bunch of lines (around 45 lines) of "asdf", called File.txt, and I copy and paste the example line:
TF_LineNumber("File.txt",1,15,A_Space)
Nothing happens to the file - the file is not changed at all. And this is copied from the example so there is absolutely no way I could have messed it up.
It's not a permission issue either, since I can write to the file with normal AHK code.

Not a Recognized Action

I'm on 1.1.30.03 and I'm using SciTE4AutoHotKey as my editor, when I try to run my application with the ahk in the Lib folder I get the following error message:
image
I will admit that this is the first time I'm using a Lib file so maybe I'm doing something wrong or I'm running a build of AutoHotKey that isn't compatible with this Lib but any assistance would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.