# Allow creating user macros inside AI outline tags

**URL:** <https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549>\
**Category:** feature\
**Tags:** done\
**Created:** [December 11, 2024, 6:16am UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549 "2024-12-11T06:16:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [December 11, 2024, 6:16am UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/1 "2024-12-11T06:16:30Z")

</div>

## 1. The problem

The only place to specify macros is inside the user macros section

Currently for ai outlines, you can send prompts but can not chain prompt because of the lack of macro support.

FOR EXAMPLE:

```auto
<prompt_h2>
%writeH2section% = [Write a section about %h2%]
%filter1% = [Summarize %writeH2section% into 1 paragraph]
%filter2% = [openai alt1|Llama3.1: Bold important words from %filter1%]
%finaldraft% = [openai alt1|Phi3.5: Fix Grammar and Humanize %filter2%]

%finaldraft%
</prompt_h2>

```

## 2. Simple solution

Allow use of macros inside AI outline prompt tags

---

<div class="post-metadata">

**Author:** ![rcimedia](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@rcimedia](https://forum.seocontentmachine.com/u/rcimedia)\
**Post date:** [December 12, 2024, 8:06pm UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/2 "2024-12-12T20:06:39Z")

</div>

we need this!!!

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [December 16, 2024, 7:28am UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/3 "2024-12-16T07:28:08Z")

</div>

## Parsing inline variables

This feature will be referred to as adding ‘inline variables’

First thing we need to do is parse inline variables inside the prompt section.

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/c/c830d5323e767a08fdabdb281b29b71035c534f2.png)

We need to remove them properly,

![image](https://forum.seocontentmachine.com/uploads/default/original/2X/3/3db078a81a75312f417f7b9fdc88d81daf69b42d.png)

And store them in a list

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/3/392c3c82dec7613f7b72df6ec5c35e028ade4840.png)

So that we can find macros, they must:

1. Entire macro definition on one line
2. Must have only 1 = sign
3. The macro name must be defined between 2x% signs. eg %macro%

If any of these conditions fail, the macro won’t be extracted and will be left inside the prompt.

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [December 17, 2024, 10:07am UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/5 "2024-12-17T10:07:58Z")

</div>

## Dev update

Inline macros inside `<ai_outline_prompts>` are now supported.

Example:

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/8/8ada789f629398386104a8f69c5c4e99335e7247.png)

It will correctly parse the inline macros. In this example it finds all 4 of them.

![image](https://forum.seocontentmachine.com/uploads/default/original/2X/a/a56542e48f62cd8a61be9f9e799c8e5a168cdfd1.png)

Because all 4 macros are being sent to the AI…

You can verify that the correct prompts are being sent to the AI model in the task log.

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/8/83d35bf50e8f1830013ccb0c2350ba9c709b1ea6.png)

The output looks like this

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/7/7d39c308fa0ed739842458288bd66459b25ae241.png)

Another example

For each h3, we ask the AI model to write a joke

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/7/7c5a9017e6288c6aa465b6d4819da428d8f860f2.png)

Check the task log.

We expect it to find 1 inline macro, and to write out that joke in `<p>` tag

![image](https://forum.seocontentmachine.com/uploads/default/original/2X/f/f75d823c86e9f18eab19157d0d04647e1518800a.png)

When we check the sample.

 ![image](https://forum.seocontentmachine.com/uploads/default/original/2X/2/2b662827419771d54473702b9d5b4b6d14a98d80.png)

The H3 prints the instruction sent to the AI.

The P displays the actual output from the AI model.

Now that inline prompts inside ai outlines are possible, it opens the door for much more complex prompt chaining in long form articles.

---

<div class="post-metadata">

**Author:** ![rcimedia](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@rcimedia](https://forum.seocontentmachine.com/u/rcimedia)\
**Post date:** [December 19, 2024, 9:08pm UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/6 "2024-12-19T21:08:32Z")

</div>

Have you pushed out this update? I didn’t get an update notice. What is the latest version?

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [December 20, 2024, 3:38am UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/7 "2024-12-20T03:38:28Z")

</div>

Just grab it manually.

> **[Download | SEO Content Machine](http://seocontentmachine.com/download/)**
>
> x86 setup

The version number is renamed from 2024-\>24

So manual update required this one time for auto updates to work correctly.

---

<div class="post-metadata">

**Author:** ![rcimedia](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@rcimedia](https://forum.seocontentmachine.com/u/rcimedia)\
**Post date:** [December 20, 2024, 3:15pm UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/8 "2024-12-20T15:15:08Z")

</div>

Error installing over previous version … do i need to uninstall? If so, will I lose all my work?

> **[20.12.2024\_10.13.34\_REC](https://screenrec.com/share/BuzhivtJTl)**
>
> Recorded with ScreenRec

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [December 20, 2024, 5:48pm UTC](https://forum.seocontentmachine.com/t/allow-creating-user-macros-inside-ai-outline-tags/549/9 "2024-12-20T17:48:42Z")

</div>

Feel free to remove previous install.

Running the uninstall won’t remove your settings.

Then install it using the new msi setup.
