# Sprite Properties Shows File Path Despite Preferences

**URL:** https://community.aseprite.org/t/sprite-properties-shows-file-path-despite-preferences/14206
**Category:** Bug Reports
**Created:** [May 10, 2022, 12:58am UTC](https://community.aseprite.org/t/sprite-properties-shows-file-path-despite-preferences/14206 "2022-05-10T00:58:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![behreandtjeremy](https://community.aseprite.org/user_avatar/community.aseprite.org/behreandtjeremy/32/6606_2.png) [@behreandtjeremy](https://community.aseprite.org/u/behreandtjeremy)
#### Post date: [May 10, 2022, 12:58am UTC](https://community.aseprite.org/t/sprite-properties-shows-file-path-despite-preferences/14206/1 "2022-05-10T00:58:55Z")

</div>

Hi all,

When I go to `Edit > Preferences > Files`, uncheck the `Show full file name path` tick box, press the `Apply` button, press the `OK` button, then go to `Sprite > Properties`, a sprite’s file path is still displayed. This is assuming that the file is not a new, unsaved sprite. I tested in versions 1.2.34 and 1.3beta14 on Windows 10.

If this is not a bug, my suggestion would be to mask the file path out. A button could unmask it. Maybe whether or not the button is shown and the path is masked could depend on the preferences tick box.

I’m posting here, not on the Github [issues](http://github.com/aseprite/aseprite/issues) page, because a stop-gap is possible with a Lua script. I left out a few things from the workaround; see notes below as to why.

 ![spriteProps1](https://community.aseprite.org/uploads/default/original/2X/a/aad0ca34524e831dffafd6e5d02b54e43477512a.png)

 ![spriteProps2](https://community.aseprite.org/uploads/default/original/2X/8/84b02676472b64967a54a2f1987c5c3667cf508b.png)

The red square in the second image was edited in.

Thanks for considering.  
Jeremy

```nohighlight
local textLenLimit = 48
local sprite = app.activeSprite

if not sprite then return end

local appVersion = app.version
local versionMajor = appVersion.major
local versionMinor = appVersion.minor
local is13 = versionMajor > 0 and versionMinor > 2

local filename = sprite.filename
local ext = app.fs.fileExtension(filename)
local title = app.fs.fileTitle(filename)

local path = ""
local showFullPath = app.preferences.general.show_full_path
if showFullPath then
    path = app.fs.filePath(filename)
    if path and #path >= textLenLimit then
        path = string.sub(path, 1, textLenLimit) .. "..."
    end
end

local spec = sprite.spec

local colorMode = spec.colorMode
local colorModeStr = ""
if colorMode == ColorMode.RGB then
    colorModeStr = "RGB"
elseif colorMode == ColorMode.INDEXED then
    colorModeStr = "Indexed"
elseif colorMode == ColorMode.GRAY then
    colorModeStr = "Grayscale"
end

local colorSpace = spec.colorSpace
local csName = ""
if colorSpace then
    csName = colorSpace.name
    if csName and #csName >= textLenLimit then
        csName = string.sub(csName, 1, textLenLimit) .. "..."
    end
end

local palCount = #sprite.palettes[1]
local palCountStr = string.format("%d", palCount)

local sprPixelRatio = sprite.pixelRatio
local pixelWidth = sprPixelRatio.width
local pixelHeight = sprPixelRatio.height

local pxRatioStr = ""
if pixelWidth == 1 and pixelHeight == 1 then
    pxRatioStr = "Square Pixels (1:1)"
elseif pixelWidth == 2 and pixelHeight == 1 then
    pxRatioStr = "Double-wide Pixels (2:1)"
elseif pixelWidth == 1 and pixelHeight == 2 then
    pxRatioStr = "Double-high Pixels (1:2)"
end

local width = spec.width
local height = spec.height
local dimStr = string.format("%d x %d", width, height)

local frameCount = #sprite.frames
local frameStr = string.format("%d", frameCount)

local sprColorRef = nil
local sprColorVal = nil
if is13 then
    sprColorRef = sprite.color
    sprColorVal = Color(
        sprColorRef.red,
        sprColorRef.green,
        sprColorRef.blue,
        sprColorRef.alpha)
end

local sprUserData = ""
if is13 then
    sprUserData = sprite.data
end

local dlg = Dialog { title = "Sprite Properties +" }

if title and #title > 0 then
    dlg:label {
        id = "titleLabel",
        label = "Title:",
        text = title
    }
    dlg:newrow { always = false }
end

if ext and #ext > 0 then
    dlg:label {
        id = "extLabel",
        label = "Extension:",
        text = ext
    }
    dlg:newrow { always = false }
end

if path and #path > 0 then
    dlg:label {
        id = "pathLabel",
        label = "Path:",
        text = path
    }
    dlg:newrow { always = false }
end

if csName and #csName > 0 then
    dlg:label {
        id = "clrSpaceLabel",
        label = "Color Space:",
        text = csName
    }
    dlg:newrow { always = false }
end

if colorModeStr and #colorModeStr > 0 then
    dlg:label {
        id = "clrMdLabel",
        label = "Color Mode:",
        text = colorModeStr
    }
    dlg:newrow { always = false }
end

dlg:label {
    id = "palCountLabel",
    label = "Palette Length:",
    text = palCountStr
}
dlg:newrow { always = false }

dlg:label {
    id = "dimLabel",
    label = "Dimensions:",
    text = dimStr
}
dlg:newrow { always = false }

dlg:label {
    id = "frameLabel",
    label = "Frames:",
    text = frameStr
}
dlg:newrow { always = false }

if is13 then
    dlg:color {
        id = "sprColor",
        label = "Color:",
        color = sprColorVal
    }
    dlg:newrow { always = false }
end

if is13 then
    dlg:entry {
        id = "sprUserData",
        label = "User Data:",
        text = sprUserData,
        focus = false
    }
end

dlg:combobox {
    id = "pxAspectDropdown",
    label = "Pixel Aspect:",
    option = pxRatioStr,
    options = {
        "Square Pixels (1:1)",
        "Double-wide Pixels (2:1)",
        "Double-high Pixels (1:2)" }
}

dlg:button {
    id = "confirm",
    text = "&OK",
    focus = false,
    onclick = function()
        if sprite and app.activeSprite == sprite then
            local args = dlg.data
            local pxAspectStr = args.pxAspectDropdown
            local sprColor = args.sprColor
            local userData = args.sprUserData

            if pxAspectStr == "Double-wide Pixels (2:1)" then
                sprite.pixelRatio = Size(2, 1)
            elseif pxAspectStr == "Double-high Pixels (1:2)" then
                sprite.pixelRatio = Size(1, 2)
            elseif pxAspectStr == "Square Pixels (1:1)" then
                sprite.pixelRatio = Size(1, 1)
            end

            if is13 then
                sprite.color = sprColor
                sprite.data = userData
            end
            
            app.refresh()
        end
        dlg:close()
    end
}

dlg:button {
    id = "cancel",
    text = "&CANCEL",
    focus = true,
    onclick = function()
        dlg:close()
    end
}

dlg:show { wait = false }

```

Notes:

1. Unlike the `Sprite > Properties` dialog, the user is able to perform other actions while the script’s dialog is open. That can include opening the script dialog before any sprite is open, while the home tab is in focus, closing a sprite after the script dialog is open, switching between sprites, or opening the default properties menu and applying changes. This script handles none of those actions gracefully. There is potential to handle them better, maybe with [events](https://github.com/aseprite/api/blob/main/api/sprite.md#spriteevents) for anyone who knows more about them.

2. The file’s size in memory is not included. The default includes it in parentheses after the pixel dimensions.

3. In [version](https://github.com/aseprite/api/blob/main/api/version.md#version) 1.3 beta, the default properties allows display toggle of the sprite’s tab color and user data with a button to the right of its file name. If desired, a dialog widget’s `visible` property can be changed with [modify](https://github.com/aseprite/api/blob/main/api/dialog.md#dialogmodify). Sprite user data and color cannot be changed in 1.2.34.

4. Assigning or converting a sprite’s [color space](https://github.com/aseprite/api/blob/main/api/colorspace.md#colorspace) is its own deal imo. See [this script](https://github.com/behreajj/AsepriteAddons/blob/main/dialogs/color/setColorProfile.lua) if interested. I doubt there’s any technical reason why it can’t be combined with the above. Scripts which read or write to file require extra user permissions to work.

5. Afaik, more than one unresolved bug is related to a sprite’s transparent color index. This property can be get and set by script; if interested, see the [source code](https://github.com/aseprite/aseprite/blob/e823ee37e9ac86d606e0060784c57e6e9e654e09/src/app/script/sprite_class.cpp#L714). I’m still debating how to design around this problem, that’s why I left it out.

6. You could add all sorts of extra diagnostics, as discussed in this [thread](https://community.aseprite.org/t/pixel-stats-check-the-total-amount-of-colored-pixels-you-used-in-your-art/1897) and likely other threads I couldn’t find. In this post, I’m only interested in replicating the default window’s properties minus omissions noted above.

7. A keyboard shortcut can be assigned to a script by going to `Edit > Keyboard shortcuts`.
