Jump to content

smoking bunny

Member
  • Posts

    11
  • Joined

  • Last visited

Everything posted by smoking bunny

  1. @david ferguson excuse coming back late on this. just doing stuff so it is just to have a hotkey to create a brand new, blank project. and i did get something to some good affect, which i have put on my github. which is good, of sorts. if you give it a try you will see, its just a script actually, that then creates all the files folders etc. but it a bit big in terms of code for my liking this was just to be for a single language, which is lua/love2d. mainly because what it contains, or would like the file to contain is specific. but let me start in explaining what it is im after and steps im going through 1. so for the initial alfred file i would like to store the files that would end up being created, to be stored in the workflow itself. so when i right-click on my workflow and click on 'show in finder', the required files will be stored in that workflow space. 2. when i type 'makelove', this will start the 'alfred is working for makeLOVE' process. to which i then have to put in a project name. 3. when chosen name is done i press enter and it creates on the top-most finder window open. though im looking to change it so you can select what folder it will be saved in through alfred instead 4. the created file should then have been just simply copied from what i had 'stored' in the workflow when first making it. this would then just make a copy to where it is created. so, essentially it is copying over what i had 'stored' in the workflow @vitor ill give your workflow a look-see. though as i have just put, im looking to make one thats just for LOVE2D project generating. but i will give it a look. i think its just so if i really need to add anything specific it wont conflict. this is what im thinking of it thanks again
  2. actually here is the exported file that ive done so far http://smokingbunny.net/downloads/alfred/makeLO%CC%88VE.alfredworkflow
  3. ive just spotted this. asd was wondering whether someone know about how i can add pre-built files to the new created folder im keeping the pre-built files in the workflow source. but dont know how to implement them in. they are LUA files, something to start new projects off without having to do the typing as much here is what i have done. slightly different to what your working on, but is aimed at the same way to create and add files to the created project right ive gotten pretty far. which is good. the one and only problem i need help with, is adding the pre-built files. but im close so here is the first parts file action QUERY={query} mkdir "$QUERY/untitled folder" open "$QUERY" then have keyword to activzate the process source includes.sh #Query from user (folder's name) QUERY={query} if [ ! "$QUERY" ] ; then QUERY="untitled folder" fi > "$FILE" echo "$QUERY" > "$FILE" which has a search folder script to save to attach to the previous one tell application "Alfred 2" to search "folder " lastly this is the desitination of where it will be saved source includes.sh #Query from user QUERY={query} #Read line from file folder_name=$(head -1 "$FILE") destination="$QUERY/$folder_name" destination_check="$destination" #Count of existing folders with same name count=1 if [ "$folder_name" ] ; then while [ -e "$destination_check" ] do echo "incrementing count" #increment counter count=`expr $count + 1` echo "current query: $destination_check" destination_check="$destination $count" done < "$destination_check" mkdir -p "$destination_check" echo "final query: $destination" open "$QUERY" > "$FILE" else open "$QUERY" fi now i have the files in the workflow itself, with an 'include.sh'. but cant figure out how to link those files with the created folder. once i get that. its done, and i wont bother whomever for some time include.sh #Working Directories DATAPATH="$HOME/Library/Application Support/Alfred 2/Workflow Data/smokingbunny.makeLOVE" FILE="$DATAPATH/main.lua" FILE="$DATAPATH/conf.lua" #Enable aliases for this script shopt -s expand_aliases #Case-insensitive matching shopt -s nocasematch #First run check if [ ! -e "$FILE" ]; then mkdir "$DATAPATH" touch "$DATAPATH/main.lua" touch "$DATAPATH/conf.lua" fi so this is what i have, just need help with the files being added thanks if someone can help
  4. right ive gotten pretty far. which is good. the one and only problem i need help with, is adding the pre-built files. but im close so here is the first parts file action QUERY={query} mkdir "$QUERY/untitled folder" open "$QUERY" then have keyword to activzate the process source includes.sh #Query from user (folder's name) QUERY={query} if [ ! "$QUERY" ] ; then QUERY="untitled folder" fi > "$FILE" echo "$QUERY" > "$FILE" which has a search folder script to save to attach to the previous one tell application "Alfred 2" to search "folder " lastly this is the desitination of where it will be saved source includes.sh #Query from user QUERY={query} #Read line from file folder_name=$(head -1 "$FILE") destination="$QUERY/$folder_name" destination_check="$destination" #Count of existing folders with same name count=1 if [ "$folder_name" ] ; then while [ -e "$destination_check" ] do echo "incrementing count" #increment counter count=`expr $count + 1` echo "current query: $destination_check" destination_check="$destination $count" done < "$destination_check" mkdir -p "$destination_check" echo "final query: $destination" open "$QUERY" > "$FILE" else open "$QUERY" fi now i have the files in the workflow itself, with an 'include.sh'. but cant figure out how to link those files with the created folder. once i get that. its done, and i wont bother whomever for some time include.sh #Working Directories DATAPATH="$HOME/Library/Application Support/Alfred 2/Workflow Data/smokingbunny.makeLOVE" FILE="$DATAPATH/main.lua" FILE="$DATAPATH/conf.lua" #Enable aliases for this script shopt -s expand_aliases #Case-insensitive matching shopt -s nocasematch #First run check if [ ! -e "$FILE" ]; then mkdir "$DATAPATH" touch "$DATAPATH/main.lua" touch "$DATAPATH/conf.lua" fi so this is what i have, just need help with the files being added
  5. ok. this will be my last question for this matter which is a definite, i dont need anything high class, so am making it low-brow so im going to go the route of copying 2 files that i have already made. both are lua files, which, when keyworded will create a project file with the 2 files in. pretty much a project starter pack. but after looking through some of the code ive found with bash script, im not getting what i thought i would. so need some tiny bit of help • so im looking to create a new project folder with a keyword. would it be good to store the files in a folder located in the workflow already. and if so, how can this be renamed to what you would call your project. or if not to store them, how can they be 'collected' when created • i was testing this bash script for just copying the file and have put it in, with the right path [though this shows for example purposes], but pasting just using the keyboard on the desktop, did not work cp /path/to/conf_file.txt • im looking to have it create a new folder, with the files located inside. but im trying to name the folder as well, with the files in. i got the mkdir to work fine to the desktop, but am stuck on the renaming of the folder and for it to create on the open finder window. mkdir /Users/lepton/Desktop/newFolderNameIdLikeToSet • should i keep the files that will be put in the folder in a folder itself in the workflow? i think that all im trying to find. im looking around still. so will post something up if i find what i can. will see thanks
  6. ah fantastic. tahnk you for that. ill have a look and dont worry, i wasnt directing the question at you. as i said, it was more for me to understand it further. kind of thinking out loud, but also means it documented and wont get too confused when reading it back thanks again. though i did have a thought on how i can implement it. and did think to look at the 'new text file with tag' workflow. that seems to have a lot of what i need. so will pick that apart and work it out but, again, thanks ill check it out
  7. actually let me try and make this easier for me to understand and explain further. or less i think this is what i want for this specific task so i just want to do a 'hotkey' creation of a txt file which already has some info i want in to be created every time i do the hotkey. rather than having to type it again. i have stored the files i want to 'create' in the finder window, but having trouble getting them to paste into the finder window does that make more sense? im just scouring for copy/paste scripts, but to get the location path of the files [in the workflow itself] is troublesome. since the location/user changes for other users
  8. sorry about the multiple posts. that last one didnt show up in my browser, and i forgot if i had put it in. so please excuse that. cool. well. im just looking at including the files in the workflow, and just trying to 'write' them to the finder window thats open. bt just running into walls with the copying to the finder paste. thanks
  9. anyone? im looking at the 'new file workflow' for pointers. but im gusseing you could have something different which does just 'copy' the included files that were to be written into the finder window
  10. or even, iwas thinking of this. could i just include the specific files needed to create the new one? actually, could that be done and be packed so you didnt have to have the files separate and were 'in' the workflow? so all you would need to do is a have a kind of 'copy' function? i guess
  11. howdy all, first time posting long time user. so, 'hello all, its lovely to be here' what im looking to do is a nice quick way of creating a new file with alfred, BUT, unlike with the 'new file workflow, this one will have setting input to the file. pretty much, a specific creation of a new file. was wondering how to go about this? example ------ say, i want to create a new text file, with some text already in it each time. doenst matter where, just need that text thanks and all the best
×
×
  • Create New...