# Can't have embedded rename script in Script Function mode

**URL:** <https://resource.dopus.com/t/cant-have-embedded-rename-script-in-script-function-mode/26325>\
**Category:** Help & Support\
**Created:** [July 8, 2017, 11:24am UTC](https://resource.dopus.com/t/cant-have-embedded-rename-script-in-script-function-mode/26325 "2017-07-08T11:24:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yeremee](https://resource.dopus.com/user_avatar/resource.dopus.com/yeremee/32/27337_2.png) [@Yeremee](https://resource.dopus.com/u/Yeremee)\
**Post date:** [July 8, 2017, 11:24am UTC](https://resource.dopus.com/t/cant-have-embedded-rename-script-in-script-function-mode/26325/1 "2017-07-08T11:24:16Z")

</div>

If I set the new **Script Function** editing mode for an embedded rename script (javascript) and save it...

![](https://resource.dopus.com/uploads/default/original/3X/f/a/fa64504e334c4e0aac45a3d543cc07ac41427232.png)

...then I get an error:

![](https://resource.dopus.com/uploads/default/original/3X/c/9/c9ddf1aa3121e65f0f30f9bad0a81ebd8f7a70fc.png)

But if I set the **Standard Function** editing mode for the script and save it, no error is generated:

![](https://resource.dopus.com/uploads/default/original/3X/0/6/065ad779f4870f7c200aafbf63ee02e2cbe84155.png)

Please, fix the new **Script Function** editing mode for using with embedded rename scripts.

_I'm using Opus 12.6 (evatuation)_

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 8, 2017, 11:29am UTC](https://resource.dopus.com/t/cant-have-embedded-rename-script-in-script-function-mode/26325/2 "2017-07-08T11:29:52Z")

</div>

This is not a bug.

Rename commands are run via Standard Function mode, as with any other internal commands. You can also put a rename script after the commands if you want to use one.

Script Functions run scripts, ONLY. You can't have a Copy or Rename or other internal command at the top of a script. (Scripts can run internal commands via the Command object, but you can't just out the raw commands at the top of the script.)

If it seems weird, it's because at one point there were no Script Functions and the Rename command was a special case. (It still is a special case in that it's an internal command which can run a script, while usually it's the other way around.)
