Jump to content
vitor

TemplatesManager — Save and reuse files, directory structures, and urls

Recommended Posts

Update.


Get (Path) Finder window with JXA. Thank you again, @deanishe, for the Path Finder parts.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.

Share this post


Link to post

I think that's because you're getting a URL from Finder, not a path.

 

AFAIK, by convention, directory URLs end with a slash, but directory paths don't.

Edited by deanishe

Share this post


Link to post
38 minutes ago, deanishe said:

I think that's because you're getting a URL from Finder, not a path.

 

AFAIK, by convention, directory URLs end with a slash, but directory paths don't.

 

I agree. That’s why I suspected that since Path Finder was using posixPath instead of url (which I consider very much a hack — they could’ve just given us a proper solution — it even includes file://) that the results would be inconsistent. Since that matters to the workflow, I had to verify. I ended up getting the path in Finder and performing a final .slice(0, -1) to remove the trailing slash.

 

Though I’ll say all in all I always preferred having a trailing slash in directories to make it easy to differentiate between a file and a directory by just reading a path.

Share this post


Link to post
53 minutes ago, vitor said:

Though I’ll say all in all I always preferred having a trailing slash in directories to make it easy to differentiate between a file and a directory by just reading a path.

 

For human-readable paths, definitely, but I prefer without the trailing slash for code. It makes working with paths so much easier (especially in shell scripts). tmpdir=${dirpath}.tmp would be a lot more work with trailing slashes.

Share this post


Link to post
29 minutes ago, deanishe said:

For human-readable paths, definitely, but I prefer without the trailing slash for code. It makes working with paths so much easier (especially in shell scripts). tmpdir=${dirpath}.tmp would be a lot more work with trailing slashes.

 

That’s a good point. Is there a meme for “I’d like to change my answer”?

Share this post


Link to post

Update.


New new icon.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

Update.

 

Added the option to set a custom templates dir. This is will allow you to easily set up syncing with any service you like. The new custom_templates_dir Workflow Environment Variable enables that setting. If you leave it blank, everything will work the same.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

Hi, I'm currently using this workflow and it works perfectly, although I use it mostly on 1 folder "Projects" where I create a project folder with a defined structure. Thing is, the folder is created on the active finder window as intended.

 

What I would like to do is:

 

Call Alfred and my template gets created in a defined folder /home/projects/(create here) always, and then the finder opens a windows with the folder selected allowing me to easy rename and start interacting with it, any clue on how to do this? TIA.

Share this post


Link to post

@Beto From the README:

 

On 29/05/2014 at 2:58 AM, vitor said:

If you have a template that consists of a directory, you can place inside it an executable script with the name starting as _templatesmanagerscript. (the extension will be your pick), to be executed automatically after copying.

 

You can do whatever in your script. Since what you want to do is always the same, you can setup the script to do your actions. You can even save said script in TemplatesManager itself!

 

Share this post


Link to post

Update.


Require full paths when setting a sync directory.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

Share this post


Link to post

Hey! Im having trouble with folders containing non latin character in their name, is there something can be done to make it work?

 

Error code is this:

 

[12:30:59.466] ERROR: Templates Manager[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1359:in `mkdir': No such file or directory @ dir_s_mkdir - /Users/nrebrikov/Downloads/ÑеÑÑ/02 From client (Errno::ENOENT)

Share this post


Link to post
18 hours ago, vitor said:

Unfortunately, I’m unable to reproduce. It’s working fine for me.

Oh, i forgot one important thing — i want to use tml +⌘, so im actually trying to put the content of my template inside a Downloads/Тест folder, this way it doesn't work.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...