raguay.customct Posted November 14, 2014 Share Posted November 14, 2014 (edited) Hi, Just uploaded two new (old for me) workflows that I find very useful and thought someone else might like them. They are: Copy/Move To WorkflowThis workflow starts with a "Add Directory to Copy/Move locations..." File Action to create a list of directories to use as targets for a copy/move operation. If actioned on a file, the directory of the file is saved.Once you have a list, you can use "copy to..." or "move to..." file actions to move or copy files to a previously saved directory.The keyword "cm:fav" is used to view saved directories, remove one, go to one in Alfred Browser, open in Finder, or go to in terminal/iTerm depending on your terminal preset in Alfred. Alfred Browser Toolbox Keywords ff It is a way to lookup a folding in the Alfred browser or in Finder. Very handy. ab:newfile Creates a new file in the directory of the topmost Finder, Commander One, or Path Finder window. ab:newdir Creates a new directory in the directory of the topmost Finder, Commander One, or Path Finder window. ab:open Opens the URL, URI, or file given using the Mac OS X open terminal command. This has a hot key as well to open the current selection with "open". This works with Finder, Path Finder, and Commander One. ab:pdf This is a file filter for PDF files. I have many and this really makes finding them easy. ab:cparent This command will get the currently selected file in Finder, Path Finder, or Commander One and copy it to the parent directory. Works on files or directories. This has a Hotkey as well. ab:mparent This command will get the currently selected file in Finder, Path Finder, or Commander One and move it to the parent directory. Works on files or directories. This has a Hotkey as well. ab:cfile This command will copy the contents of the file to the clipboard. You need to be sure it is a text file. This has a Hotkey as well. Alfred Browser Actions Get File Name This gets the name of the file selected in Alfred Browser and puts it into the clipboard. Get File Size This gets the file size of the file selected in the Alfred Browser and puts it into the clipboard. Create a File Simply creates a file in the directory this file action is ran on. It will ask you for the name and then create it. Create a Directory Same as "Create a File", but creates a directory instead. Copy Relative Home Path This file action calculates the relative path from the user’s home directory and copies it to the clipboard. Paste Relative Home Path This file action copies the absolute path to the clipboard. It will then paste the relative path to the topmost application. Copy Absolute Path This file action copies the absolute path to the clipboard. Paste Absolute Path This file action calculates the relative path from the user’s home directory and copies it to the clipboard. It will then paste the relative path to the topmost application. Copy/Move to Parent Directory These two actions will copy/move the selected file to the parent directory. Copy File Contents to Pasteboard This action will copy the contents of the file to the pasteboard. NOTE: Currently this requires OS X 10.10 because I am using JavaScript for Automation that is only in 10.10. Sorry! Version: 1.5 Date: 12/04/2015 You can get them from my Github account: https://github.com/raguay/MyAlfred or Packal: http://www.packal.org/workflow/copymove http://www.packal.org/workflow/alfred-browser-toolbox Edited December 4, 2015 by raguay.customct 40-02 1 Link to comment
raguay.customct Posted November 14, 2014 Author Share Posted November 14, 2014 Just updated the Copy/Move workflow to allow for directory aliases to make displaying of the directory better. Link to comment
politicus Posted November 17, 2014 Share Posted November 17, 2014 It looks like an awesome workflow. Unfortunately, I couldn't make it work. Got the error: Starting debug for 'Files - Copy/Move to' [INFO: alfred.workflow.trigger.action] Processing output 'alfred.workflow.action.script' with arg '( "NAME_OF_A_FILE_LOCATED_IN_THE_DOWNLOADS_FOLDER.pdf" )' [ERROR: alfred.workflow.action.script] Code 0: GetName.scpt: script error -1762. Couldn't get error text because of error -1700. [INFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.notification' with arg 'Just added: ' Downloaded from packal (v1.1) OSX 10.9.5. Link to comment
raguay.customct Posted November 17, 2014 Author Share Posted November 17, 2014 I guess I should of mentioned that it will only work in OS X 10.10 Yosemite. It is making use of JavaScript for Automation instead of AppleScript. Therefore, you would need to upgrade to 10.10. Sorry. I will look into making it backwards compatible. Link to comment
politicus Posted November 17, 2014 Share Posted November 17, 2014 I tried the workflow because on packal it says it is compatible with previous versions of OSX (ie 10.9)... I planned on installing Yosemite this week so, it is not such a big deal Link to comment
raguay.customct Posted November 17, 2014 Author Share Posted November 17, 2014 Okay. I just updated it on Packal to say just for 10.10. Sorry for the confusion. Remember to defrag before and after the update. Many people had problem by not doing that. It saves time! Link to comment
politicus Posted November 17, 2014 Share Posted November 17, 2014 Cool. Didn't hear about that issue. I planned on a clean install (erase HD before installing Yosemite) so I shouldn't need to defrag. But thanks for the tip. Link to comment
politicus Posted December 17, 2014 Share Posted December 17, 2014 (edited) #feedback Apparently, the workflow doesn't like , or ( ) or [ ] in file names / Exotic files types like .chm files. I couldn't copy one file with an exotic name. It included [ ] -> Error: No such file or directory. I couldn't move the .chm file -> Error: No such file or directory Very useful workflow. Thank for sharing. Edited December 17, 2014 by politicus Link to comment
raguay.customct Posted December 17, 2014 Author Share Posted December 17, 2014 Hi, I can not reproduce your error. Is it the copy or move function? Is it the source or destination? All of my destinations have spaces and parenthesis and true files should not make a difference. But, files that are really directories will not work since I am just using the standard unix cp command. I will experiment with making the cp function recursive and see if that helps. Update soon... Link to comment
raguay.customct Posted December 17, 2014 Author Share Posted December 17, 2014 I assume your error was with copying. The mv command is already recursive and should work with files that are really folders. Now, both are recursive and can be used on folders. Just uploaded update. Link to comment
politicus Posted December 18, 2014 Share Posted December 18, 2014 Working like a charm! What a fantastic workflow Link to comment
politicus Posted December 19, 2014 Share Posted December 19, 2014 @raguay.customct After I installed the latest version of the workflow, some of the "saved destination directories" ( = directories I added to to Copy/Move locations...) of the previously installed version of the workflow were still there. Looks like they are cached somewhere and not purged yet. The delete command of the cm:fav command didn't help me delete them as it threw an error message "strpos(): Empty needle i...". I didn't log out from OS X Yosemite. Link to comment
raguay.customct Posted December 22, 2014 Author Share Posted December 22, 2014 Just uploaded an update that gives a new command "cm:reset" that will reset all data files to base condition (empty). Link to comment
raguay.customct Posted January 2, 2015 Author Share Posted January 2, 2015 Just fixed another bug that stored files and not directories. I also added the ability to open a favorite directory in a terminal program. It uses the Alfred Terminal command that defaults to Terminal.app, but can be made to use iTerm in the Alfred configurations. Link to comment
politicus Posted January 5, 2015 Share Posted January 5, 2015 Tried the 1.4 version (from Packal). 1°) The cm:reset action is working like a charm. 2°) I couldn't perform a delete action on a directory list item. In Alfred's debug mode, I got the error: Starting debug for 'Files Copy/Move to' [ERROR: alfred.workflow.action.script] Code 0: 2015-01-05 11:02:10.482 osascript[5157:307793] warning: failed to get scripting definition from /usr/bin/osascript; it may not be scriptable. Link to comment
raguay.customct Posted January 5, 2015 Author Share Posted January 5, 2015 (edited) Okay, I found the bug in the copy/move for removing the directory from the list. The php strpos function did not do what I expected. I am now using strcmp and it seems to be working better. Not sure what your error message is coming from as that section of code doesn't use osascript. It is updated on Packal and my GitHub. Please redownload and give it a try. Edited January 5, 2015 by raguay.customct Link to comment
politicus Posted January 5, 2015 Share Posted January 5, 2015 Reinstalled the workflow and it seems to be working well. Thank you. Link to comment
raguay.customct Posted January 5, 2015 Author Share Posted January 5, 2015 No problem. Let me know if you see a feature that it needs. Link to comment
raguay.customct Posted January 16, 2015 Author Share Posted January 16, 2015 I just added a command to the Alfred Browser workflow for opening the current Finder or Path Finder folder in Alfred Browser. Link to comment
cdispoto Posted February 1, 2015 Share Posted February 1, 2015 Perhaps I am missing something, how do I choose what directories I can copy/save to? Link to comment
raguay.customct Posted February 2, 2015 Author Share Posted February 2, 2015 Perhaps I am missing something, how do I choose what directories I can copy/save to? When you are in the Alfred prompt, go to the Alfred Browser by typing in a path (ie: ~ for home). Move around to the directory you want to mark as a favorate and press right arrow. That brings up a list of possible actions. Type "Add" and select the "Add Directory to Copy/Move locations". Now, when you use the copy/move functions, that directory will show up as a possible destination. Link to comment
raguay.customct Posted August 21, 2015 Author Share Posted August 21, 2015 Hi, I just updated the Alfred Browser Workflow with many new commands. Give it a try! Link to comment
raguay.customct Posted September 21, 2015 Author Share Posted September 21, 2015 Hi, Just updated Alfred Browser with some new commands requested: copy and paste absolute file paths. Link to comment
raguay.customct Posted October 15, 2015 Author Share Posted October 15, 2015 Just updated the Alfred Browser Workflow to work with Commander One file manager as well. If you do not have Commander One, you owe it to yourself to check it out: http://mac.eltima.com/file-manager.html Link to comment
politicus Posted December 4, 2015 Share Posted December 4, 2015 A feature request for you A File action that would let me move the files I selected to its parent folder (without having to specify the name of the current folder). For more information on what I am looking for: here. Thank you. Link to comment
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