Jump to content

Directory Processing Workflow


Recommended Posts

This workflow is for sequentially going through the contents of a directory. You can get entries for file and directory separately. The are counted independently.

Set Processing Directory
This file action only appears on directories in the Alfred browser. It will set the directory that is being processed. Both file and directory counters get reset with this action.

dp:nextfile
This command will put the next file in the processing directory to the clipboard and to notifications.

dp:showdir
This command shows the directory currently being processed.

dp:reset
This resets the counts for the current file and directory.

dp:nextdir
This command will put the next directory in the processing directory to the clipboard and to notifications.

This is distributed under the MIT license.

 

Packal:         http://www.packal.org/workflow/directory-processing-workflow

GitHub:         https://github.com/raguay/MyAlfred

My Website:  http://customct.com/alfred-2-workflows

Edited by raguay.customct
Link to comment
  • 4 months later...

@raguay.customct:

 

Hi, I just downloaded the workflow on packal.org.

 

Got this error: 

Starting debug for 'Directory Processing Workflow'

[INFO: alfred.workflow.input.keyword] Processing output 'alfred.workflow.action.script' with arg ''
[ERROR: alfred.workflow.action.script] cat: /Users/User/Library/Application Support/Alfred 2/Workflow Data/com.customct.DirectoryProcessingWF/dwork.txt: No such file or directory
find: ftsopen: No such file or directory
[INFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.notification' with arg ''
[INFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.clipboard' with arg ''

I can display the  name of the directory being processed... and that is pretty much everything I can do with the workflow.

Link to comment

@raguay.customct:

 

Hi, I just downloaded the workflow on packal.org.

 

Got this error: 

Starting debug for 'Directory Processing Workflow'

[INFO: alfred.workflow.input.keyword] Processing output 'alfred.workflow.action.script' with arg ''
[ERROR: alfred.workflow.action.script] cat: /Users/User/Library/Application Support/Alfred 2/Workflow Data/com.customct.DirectoryProcessingWF/dwork.txt: No such file or directory
find: ftsopen: No such file or directory
[INFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.notification' with arg ''
[INFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.clipboard' with arg ''

I can display the  name of the directory being processed... and that is pretty much everything I can do with the workflow.

 

Hi,

 

That errors says you did not set the working directory properly. The workflow is used to step through a directory of directories that have files. You use the Alfred browser to go to the top directory and use the file action "Set Processing Directory". Then you use "dp:nextdir" to go to the first directory there. Then you use "dp:nextfile" to copy the path of the first file in the first directory in to the clipboard (or pasteboard. I'm just used to calling it the clipboard, but Apple has other words). That way you can step through each file in order (by ls standard and not Finder ordering).

 

If you only have one level of directories, you could put it into a sublevel and then use the workflow.

 

I made the workflow to step through Closed Captions files for attaching to videos where the videos are group by courses. Therefore, the directory structures is:

 

SRTDirectories

    Course1dir

         file1

         file2

    Course2dir

         file1

 

Something like that. But, I figured others might find it useful, also.

 

Let me know if this is helpful.

 

Richard

Link to comment
  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...