# Possible bug--"alignToCanvas": true only works if it's enabled in the options bar

**URL:** <https://forums.creativeclouddeveloper.com/t/possible-bug-aligntocanvas-true-only-works-if-its-enabled-in-the-options-bar/2656>\
**Category:** Photoshop\
**Created:** [March 17, 2021, 1:28pm UTC](https://forums.creativeclouddeveloper.com/t/possible-bug-aligntocanvas-true-only-works-if-its-enabled-in-the-options-bar/2656 "2021-03-17T13:28:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [March 17, 2021, 1:28pm UTC](https://forums.creativeclouddeveloper.com/t/possible-bug-aligntocanvas-true-only-works-if-its-enabled-in-the-options-bar/2656/1 "2021-03-17T13:28:55Z")

</div>

I’m trying to align some elements in a document with document boundaries using the Move tool.

batchPlay from Alchimist:

```
{"_obj": "align","_target": [{"_ref": "layer","_enum": "ordinal","_value": "targetEnum"}],"using": {"_enum": "alignDistributeSelector","_value": "ADSCentersV"},"alignToCanvas": true}
```

The

```
“alignToCanvas”: true
```

 only works if “Align to:” is set to “Canvas” in the options bar for the Move tool. It doesn’t programmatically override if “Align to:” is set to “Selection” in the options bar, which appears to be the default.

I’d expect

```
“alignToCanvas”: true
```

 to take precedence over whatever is specified in the options bar.

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [March 17, 2021, 2:04pm UTC](https://forums.creativeclouddeveloper.com/t/possible-bug-aligntocanvas-true-only-works-if-its-enabled-in-the-options-bar/2656/2 "2021-03-17T14:04:05Z")

</div>

Yep, funny enough I had the same issue a couple of days ago. I couldn’t find a way to force this option to true.  
My workaround is to call a “select all” and then call the “align”. So far it works.

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [March 17, 2021, 2:41pm UTC](https://forums.creativeclouddeveloper.com/t/possible-bug-aligntocanvas-true-only-works-if-its-enabled-in-the-options-bar/2656/3 "2021-03-17T14:41:48Z")

</div>

Yes, that was my workaround also.

But I’m unsure of whether to set “alignToCanvas” to true or false. I’m leaning towards leaving it set to “true” as that is the desired behavior, it seems, if this is fixed.

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [March 17, 2021, 10:37pm UTC](https://forums.creativeclouddeveloper.com/t/possible-bug-aligntocanvas-true-only-works-if-its-enabled-in-the-options-bar/2656/4 "2021-03-17T22:37:35Z")

</div>

I think there is one more case like that and I think it was somehow related to linked layers.
