Jump to content

Mac in Windows Environment - directory url's


Recommended Posts

I have been using Alfred just as a finder but seems I am missing out on it's power. I work in a windows environment but like using my mac. One thing I need to do daily is take a windows path and copy and paste it to open a document. I can not do that with my mac.

 

I am connected to the windows network and have mounted the domain using the SMB:/path process. 

 

For example I want to be able to paste something like N:\Mulit-Departmental Shares\IT Projects\Active Projects\test.doc in my finder and open the documnet but the windows drive does not get mounted  like that. It is almost reversed like so //Mulit-Departmental Shares/IT Project/Active Projects/test.doc

 

Is there something that can be written to do this in alfred so I could paste the windows path in and have it know where I want to go 

 

Hope all that made sense.

 

Bill

Link to comment

I have been using Alfred just as a finder but seems I am missing out on it's power. I work in a windows environment but like using my mac. One thing I need to do daily is take a windows path and copy and paste it to open a document. I can not do that with my mac.

 

I am connected to the windows network and have mounted the domain using the SMB:/path process. 

 

For example I want to be able to paste something like N:\Mulit-Departmental Shares\IT Projects\Active Projects\test.doc in my finder and open the documnet but the windows drive does not get mounted  like that. It is almost reversed like so //Mulit-Departmental Shares/IT Project/Active Projects/test.doc

 

Is there something that can be written to do this in alfred so I could paste the windows path in and have it know where I want to go 

 

Hope all that made sense.

 

Bill

 

Something like this work? Depending on your actual path you may need to edit it slightly but based on your request, it should work.

 

Workflow is based off similar workflow created by ctwise and shared here.

Link to comment

Okay so I bought the power pack and I have never used these workflows with alfred. Are you familiar with the one you gave me.. I am not sure what to actually do to use it. I see you have to assign a hot key which I did but not sure if I need to do anything else..

 

So lets say I have a windows path how do I take that and send through this workflow to convert to mac and open

Link to comment

Okay so I bought the power pack and I have never used these workflows with alfred. Are you familiar with the one you gave me.. I am not sure what to actually do to use it. I see you have to assign a hot key which I did but not sure if I need to do anything else..

 

So lets say I have a windows path how do I take that and send through this workflow to convert to mac and open

 

Oh sorry.

 

Select a windows path (don't have to copy it, just select/highlight it) and press the hotkey that you assigned. It should convert it to a network path and have that available in the clipboard for you to paste wherever you want

Link to comment

I must be doing something wrong. I selected this

 

\\Corpclusterdfs\Mulit-Departmental Shares\IT Projects\Enhancement - PIW Projects\PIW- Workbrain & SCM\Release 2\WB\3-Other\Production Control\Production Control and Support Turnover - Workbrain Release 2.pptx

 

hit my hot key and this is what I got in my clipboard.

 

\\

 

Is there a way for it to also open the path?

Link to comment

I must be doing something wrong. I selected this

 

\\Corpclusterdfs\Mulit-Departmental Shares\IT Projects\Enhancement - PIW Projects\PIW- Workbrain & SCM\Release 2\WB\3-Other\Production Control\Production Control and Support Turnover - Workbrain Release 2.pptx

 

hit my hot key and this is what I got in my clipboard.

 

\\

 

Is there a way for it to also open the path?

 

When you originally asked for the workflow, you requested that it take a Windows path (N:\Mulit-Departmental Shares\IT Projects\Active Projects\test.doc) and convert that to a network path. So, yeah I would expect it to return something weird if you didn't pass it a windows path. It removed the drive letter and colon and replaced \ with /. That's what the workflow does.

 

You CAN make it open the file afterward. We would just need to add another item to the workflow to make it open the new path after it converted it.  

Link to comment
  • 2 months later...

How do i need to modify the workflow to work with such url's: \\Srv0015\something\somethingelse\02_something\

to convert to mac forward slashes with smb:// in front? (smb://Srv005/something/somethingelse/02_something)

path = "{query}"
unc = ""

parts = path.split(':\\')
parts.delete_at(0)
unc = parts.join('/')

print "\\\\#{unc}"

thanks!

Edited by Chalkin
Link to comment

How do i need to modify the workflow to work with such url's: \\Srv0015\something\somethingelse\02_something\

to convert to mac forward slashes with smb:// in front? (smb://Srv005/something/somethingelse/02_something)

path = "{query}"
unc = ""

parts = path.split(':\\')
parts.delete_at(0)
unc = parts.join('/')

print "\\\\#{unc}"

thanks!

 

I think this should work..

path = {query}
sep = '\\'
blah = path.split(sep)
blah.pop(0)
blah.pop(0)
print "smb://"+"/".join(blah)
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...