Jump to content

Not sure why passed in path does not get open with Open File object


Recommended Posts

I have this workflow that I am trying to make.

 

I pass in the correct path as {query} into Open File object but it refuses to open it. I checked the path the passed in path by running 'code ' and that path and it works perfectly. I just can't get it to run from Alfred.

 

Perhaps I am not using Open File object correctly.

 

I also tried creating a bash script object and running 'code $1' in it but that too doesn't work. I assume Alfred doesn't know about code command that I have installed in my environment which should open a passed in path in VS Code. 

 

Thank you for any help.

Edited by nikivi
Link to comment

It's hard to determine since we can't see the code for you "alfred-edit-files" since it's binary and I can't see what this file is doing (what kind of item those it needs as input... file ? folder ? text ?)... However, I tried to send a file and the Alfred debugger complained about the JSON was missing expected keys:

 

[2017-08-12 21:11:31][ERROR: input.scriptfilter] JSON is missing expected keys; items, variables or rerunafter:
{
  "items": null
}

Maybe this is why it's not working on your side ?

 

Also, I tried to send a file to the Open File object and it has worked. I'm just not sure why to try to set "{query} : {var:PATH}" inside the "Arg and Vars" object since the {query} would be what goes out of the object and, therefore, would be what you place on the bigger text field above

Edited by GuiB
Link to comment

Thank you @GuiB, @deanishe


It was an issue with my code and the spacing was an issue. I did check debugger pane but not the 'All information' tab which is where I would have spotted this error. My bad.

 

Sorry @GuiB for the lack of info. Will release this small workflow too soon as I think it could be useful to people.

Link to comment

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...