Giter Site home page Giter Site logo

rodi01 / renameit Goto Github PK

View Code? Open in Web Editor NEW
1.4K 40.0 112.0 19 MB

Keep your Sketch files organized, batch rename layers and artboards.

Home Page: https://renameit.design/sketch/

License: MIT License

CSS 3.25% HTML 1.78% JavaScript 94.98%
sketch-plugin

renameit's People

Contributors

alienresident avatar awt2542 avatar bomberstudios avatar dwinurhadia avatar rodi01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

renameit's Issues

Option to reverse %n naming based on Sketch's logic

When duplicating layers, they move up in the sketch layer tree so to speak.
User must then move the layers in reverse order so that the rename plug will properly order with %N.
Could we have an option to reverse that naming so the top most layer isn't #1 it's actually the last number in the list?

Input focus should be accessible with keyboard

With 2.0 and Sketch 40.3 i am not able to switch the focus between input fields with my keyboard (TAB switches focus between the dialogs buttons, but ignores the text fields).

Also, the first input field should receive focus when the dialog appears.

Random crashes

Hey there,

I love your plugin a lot! It works like a charm … :-) I'm getting frequent random Sketch crashes, though. I was trying to reproduce yesterday, but couldn't figure out unfortunately. Anybody else having this issue? Should I post a crash log?

Thanks & all the best,
Christophe

Not an issues, a suggestion

Hello,
Thanks for this great plug in its amazing,
I would like to know if you could add an option to delete some characters in layer / artboard names.
I have more than 200 artboards in the app I'm currently designing and the artboard names are this:
onboarding_0056__A23_state_1

I would like to delete the "0056_" in thoses artboard names

I tried to add a function to your plugin but I don't have enough skills to fully understand the code,
the regex I was trying to use was this: (?<=_)(.*)(?=A)
(delete everything between the first _ and the A)

If you could add a feature in your plugin it would be awesome.

Thanks

%N not working

Plugin doesn't seem to work with Sketch 3.2.2
Watched the demo video 3 times. Read the instructions. Still get ten layers all named "Item %N" after running the plugin.

Feature Request

How about adding "%P" for the page name containing the artboard or layer? Would be useful sometimes.

Thanks for your work though, really like concept of this plugin.

Feature request: Renaming layers to string after last "/"

Layers get messy when you insert a symbol that is part of a well organized Library...

So for example it would be great to have a command to rename all layers to the string after last "/"

Example:
"UI / Buttons / Primary Button - Active"
becomes: -> "Primary Button - Active"

This would really help make files more usable!

Thank you!

Support Sketch 45 plugin update system

Hi there!

This is a quick note to remind you that Sketch 45 will include a plugin update system.

It would be awesome if you could add support to it (it's really easy!) before Sketch 45 comes out. Ideally, you should release an update for your plugin while we're still in Sketch 44, so your users will have a nice & easy experience when 45 is released.

For more details, please check http://sketchplugins.com/d/229-updating-plugins and http://developer.sketchapp.com/introduction/updating-plugins/

Thanks in advance!

Versions after v3.0.2 aren't installing

For whatever reason, I can't seem to install any of the newer versions. I'll double click the .sketchplugin file but nothing happens. Likewise with Sketch Runner, it downloads it but it doesn't actually install. Only using v3.0.2 seems to work (i.e. bring up the 'Plugin has been installed' alert window).

I'm fine with v3.0.2, just though I'd let you know 😉

+ replaces group layer name

If I name my group/layer "button" then attempt to add a suffix with + button, instead of adding the suffix, it just replaces the layer name with "+ button".

Sketch 3.0.3, latest RenameIt plugin.

Wildcard (*) character not working

Seems like I can no longer rename layers with the wildcard character as "match all after this point."

For example, I have the following layers:
Rect A
Rect B
Rect C

Try to rename via Find & Replace
Find: Rect*
Replace With: Circle %A

Expected Results:
Circle A
Circle B
Circle C

Actual Results:
Rect A
Rect B
Rect C

Nothing happens. I remember this working in the past, but it doesn't work anymore.

Autofocus "name" input

Hello,

Firstly I'd like to say thanks for this plugin, it's saved me a lot of time.

As of late, when renaming layers - the "name" input isn't auto focused (it used to be) when the dialog appears.

It used to auto focus the input all the time, but I'm not sure when it stopped on me. I know it's not a hardship to simply click the input to focus it, but it was very helpful when it was auto focused.

Is there any reason why this was taken out or stopped working?

Thanks!

Helper Idea : %C

Hi, just wanted to add an idea that can help designers.
Have a namer "Helper" like %C that can give color hexadecimal.

(sorry if this isn't a real issue, and sorry for bad english).

Feature request: Leading 0(s)

Thank for you for this awesome plugin, it has saved me so much time!

If possible, it'd be great to be able to enter a leading 0 in the "Starts Number Sequence From:" field. For example, I frequently rename artboards with numbers for sorting purposes, but sequence 1 - 12 sorts as: 1, 11, 12, 2, 3, 4 etc. It'd be nice to be able to create a number sequence from 01 - 12.

Feature request: rename symbol instances to actual symbol name

It would be great if you could rename symbol instances to the actual symbol name. For example, if you have 2 symbols called Button Default and Button Pressed, and you have an instance of "Button Default" that you then replace with Button Pressed, the name of the symbol instance is still "Button Default," when it's actually now an instance of Button Pressed.

Start with 01

Love this plugin! I wondered if you could add the ability to place a zero before the number when sorting by a number sequence. So the numbers could go "01, 02, 03,...10, 11, 12..."

Sometimes it fails to work

Hi, I found this plugin sometimes work but sometimes it fails to work.
I'm not sure if this happen because of sketch 4.3. It works fine in 3.3

Feature request: default to last used values

It would be nice to have a starting point sometimes. Either the current layer name or the last used value would be very helpful (pre-selected so you can just start typing to clear it out).

Thanks!

Interval for %N

Hello,

It'd be great if you add the ability to choose an interval eg. 20-29

Now it is possible to rename only from the starting number.

Thank you!

Best,
Ivan

Support regex for Find and Replace

Any chance of including regex support for the find and replace functionality?

I thought this was maybe already supported but realized I might have been thinking of a different plugin or else I forgot the syntax...

Helper Idea: Font Size - %F

Would love to have a helper that adds the font size to the name.
Super helpful if you use text symbols and you update the text size.

schermafdruk 2017-11-09 11 01 56

Helper can be something like %F. In the image above you could do something like this: Body (%Fpx)

Can't have 2 times '%N' on layers

Trying to rename my file to make them appear properly into the finder with this kind of structure :

01-Login-step1

But I the second digit isn't working it only display '%N' :

01-Login-step%N

Any chance to solve that or do you know a workaround?

Escape special characters (*, %, +)

Sometimes you need to include characters like "+" or "*" inside layer names (e.g append * to a layer when building prototypes with framer.js). It could be useful to escape their special-power (e.g. putting "" before the sign, like in regular expressions)

Feature Request: Search scope

it would be great that adding a switch for "find & replace layer names" feature like
□ whole document
□ current page
□ selected layer

Reverse %N order for the selected layers

Hello,

It'd be great if you add the ability to choose the type of order:

  1. From first to last
  2. From last to first

Now it is possible to rename from the first to the last layer.

Thank you!

Best,
Ivan

Variable Parent Name

Hi,

First of all, I love this plugin.

I would like to ask if it's possible to have a parent variable, just like the use of the '*', but then something like '*P' which will use the name of the folder that your elements are in. This would be super useful.

Thanks!

Width and Height

Added the ability to rename using %w and %h for width and height.

// (ctrl cmd r)
// Rename layer(s) like a boss

// The Brain
function rename(layerName, currIdx, width, height) {
    var per     = basename.search("%"),
    interSize   = 0
    isN         = true;

    // Interator
    if (per != -1 && per != basename.length && (basename[per + 1] == "N" || basename[per + 1] == "n")) {
        isN = basename[per + 1] == "N";

        for (var i = per + 1; i < basename.length; ++i) {
            if (isN) {
                if (basename[i] != "N") break
            } else if (basename[i] != "n") break;

            ++interSize;
        }

    }

    var inter       = isN ? selection.length() + 1 : 0,
    newLayerName    = basename;

    if (interSize > 0) {
        var interStr = (isN ? currIdx + 1 : selection.length() - currIdx).toString(10);

        while (interStr.length < interSize)
            interStr = "0" + interStr;

        newLayerName = newLayerName.substr(0, per) + interStr + newLayerName.substr(per + 1 + interSize);
    }

        // Add to current name
        if (newLayerName[0] == "+")
            newLayerName = layerName + basename.substring(1);

        // Wild Card Selector
        var wildCard = newLayerName.search("\\*");
        if (wildCard != -1)
            newLayerName = newLayerName.substr(0, wildCard) + layerName + newLayerName.substr(wildCard + 1);

        newLayerName = newLayerName.replace(new RegExp("%w", "ig"), width);
        newLayerName = newLayerName.replace(new RegExp("%h", "ig"), height);

        // Return new name
        return newLayerName;
    }

if (selection.length() > 0)
{
    // Show dialog
    var basename = [doc askForUserInput:'Rename Layer(s): eg. Item %N, Item %W, Item %H' initialValue:'Layer'].toString();

    // Run on all selections
    for (var i=0; i<selection.length(); i++) {
        var layer = selection[i]
          , frame = [layer frame]
          , width = [frame width]
          , height = [frame height]
          ;
        var name = rename([layer name], i, width, height);
        [layer setName:name];
    }
}
else
{
    // No layer selected
    [doc showMessage: "Rename it: You need to select at least one layer"];
}


// Run

Rename subfolders and layers inside a folder.

Amazing work, Rodrigo! I have installed it but, for example, if I have five folders and, inside, some layers and I want update all these folders and layers' name, I can't to do it. Is there some way to do it?

Thanks @rodi01 !

Change Case

Is here where you request a feature? sorry if not... 😖

how about changing case of [original name] by entering something like this

example name - My symbol

* - keeps current name "My symbol"
*lc - for lower case "my symbol"
*uc - for upper case "MY SYMBOL"
*tc - for title case "My Symbol"

love this plugin ❤️

Rename folder

Great plugin!!!

Would like to have the option to rename folders (subfolders ...) too

Best

Maik

Adjustment on pop-up modal

Hi man, I use your plugin on a daily basis, and I find it really useful 👍
There is one detail which really annoys me though, and therefore I decided to write you about it. It's a very minor thing, but it would really speed up my workflow.

Is it possible to have the first of the input fields already active when launching the plugin? Basically when I click "rename it" I would love the modal to appear blinking, so I can start typing directly, without having to grab my mouse and point into the input field to activate it?!

it's really minor, and geeky, but I'd love that!

thanks!

Numbers >= 10

At this time, it looks like %N doesn't go above 9.
Instead of numbering 9, 10, 11, 12 it returns 9, 0, 1, 2.

Edit: I know that using %NN includes leading zeros etc. but I think that the above is still true and should not go back to 0 after 9.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.