squashray Posted July 24, 2013 Posted July 24, 2013 Hello, I am looking for a workflow that will append the selected text ( it will be plain text always in Textedit) into another archive text file. That's it. The target archive file will not likely be open usually. If I have to Select the text and then copy to clipboard first, that's fine. Ideally I would be able to just select the text then trigger the Alfred workflow with the Hotkey trigger (archive file gets opened, text appended, file gets closed) and then I will delete the selected text in my working text file (inside of workflow or manually) Tried some Automator script but I couldn't configure the code syntax correctly. From : http://chronicle.com/blogs/profhacker/scripting-101-a-very-gentle-introduction-to-applescript/44969 set theText to the clipboard set theFilePath to (“/Whatever/The Path/Actually Is”) & “Whatever the Filename is.txt” set theFileReference to open for access theFilePath withwrite permission write ”” to theFileReference starting at eof write theText to theFileReference starting at eof close access theFileReference New to this. Thanks for any help. Ray
jdfwarrior Posted July 25, 2013 Posted July 25, 2013 Hello, I am looking for a workflow that will append the selected text ( it will be plain text always in Textedit) into another archive text file. That's it. The target archive file will not likely be open usually. If I have to Select the text and then copy to clipboard first, that's fine. Ideally I would be able to just select the text then trigger the Alfred workflow with the Hotkey trigger (archive file gets opened, text appended, file gets closed) and then I will delete the selected text in my working text file (inside of workflow or manually) Tried some Automator script but I couldn't configure the code syntax correctly. From : http://chronicle.com/blogs/profhacker/scripting-101-a-very-gentle-introduction-to-applescript/44969 set theText to the clipboard set theFilePath to (“/Whatever/The Path/Actually Is”) & “Whatever the Filename is.txt” set theFileReference to open for access theFilePath withwrite permission write ” ” to theFileReference starting at eof write theText to theFileReference starting at eof close access theFileReference New to this. Thanks for any help. Ray Just trying to append to a file could be done more easily via a bash script. For example.. echo "This is the text to append" >> somefile.txt Would append the text to the end of somefile.txt
raguay.customct Posted July 25, 2013 Posted July 25, 2013 I think this workflow would be nice for what you want: http://www.alfredforum.com/topic/398-fixed-scratch-files-and-thoughts/?hl=scratch I use it for making quick notes. It works very well.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now