You have to login in order to post a reply to this topic.

10 replies [Last post]
baz
User offline. Last seen 37 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 47

In Wordpress, there is a setting to change the permalink structure to a custom structure.

The structure i want is %postname% (so its identical in structure to a variable, although I dont have a variable named that) which must be input into a field, but WA wont let me pass this text using keyboard strokes...neither will it let me pass the text \%postname%...nor can I break it down and pass it piece by piece.

Any ideas what Im doing wrong would be greatly appreciated.

Baz

baz
User offline. Last seen 37 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 47
Re: Trying to input %postname%

correction, the syntax is \%postname%\ and I've tried \\%postname%\ and \%postname%\ with no success.

codex
codex's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 161
Re: Trying to input %postname%

Have you tried \%postname\% ? The backslash should be placed before every different percent character. A more detailed description about why this is happening can be found here: http://winautomation.com/kb/how-use-variables-file-paths

__________________

Error is not blindness, error is cowardice

__________________

Error is not blindness, error is cowardice

WayCoolJr
User offline. Last seen 1 year 30 weeks ago. Offline
Joined: 11/14/2009
Posts: 7
Re: Trying to input %postname%

The correct syntax for: \%postname%\

Would be: \\%postname\%\

You have to put a backslash before the % sign or it will confuse WA. The backslash is known as an escape in that it "escapes" normal behaviour by WA and tells it that this time, the % sign is not the beginning of a variable name.

baz
User offline. Last seen 37 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 47
Re: Trying to input %postname%

Guys

I understand the \\ issue with file names, this is different. The syntax avove triggered a fail from winauto since "there is no variable by that name".

I cant find a way to pass this exact text as keystrokes.... \%postname%\

All the best

 

Barry

WayCoolJr
User offline. Last seen 1 year 30 weeks ago. Offline
Joined: 11/14/2009
Posts: 7
Re: Trying to input %postname%

I was not talking about file names, I was talking about sending text.

You have to have the escape character (\) just before every per cent sign if you are trying to send a per cent sign as part of your text : \%

When you do this, the escape character will not be counted in the text you send.

Therefore, if you send \% through a keystroke, WA will see that as a % sign and not a variable.

Your example, \%postname%\ escapes the first per cent sign, but not the last per cent sign, so WA thinks on that last per cent sign you are trying to call a variable. And it ignored your first backslash because it thought you were escaping the % sign.

So, if you want to send \%postname%\ as your text, then you should send it this way: \\%postname\%\

In effect, I have replaced the % with \% so that WA can understand.

Try it -

codex
codex's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 161
Re: Trying to input %postname%

Please find a job attached that will specifically send the text:

\%postname%\

as keystrokes to a Notepad and also print it into a Message Box.

I hope that this is what you need :p

AttachmentSize
Send Specific Text.waj 14 KB
__________________

Error is not blindness, error is cowardice

__________________

Error is not blindness, error is cowardice

baz
User offline. Last seen 37 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 47
Re: Trying to input %postname%

Guys

Thanks for the responses...but still not working. Have attached 2 10 second videos.

http://screencast.com/t/ZjNkODM4Y
http://screencast.com/t/MGM0ZTE4ZmQ

All the best

Barry

 

codex
codex's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 161
Re: Trying to input %postname%

Baz,

Please check the second video again. The job is working normally and you can see that in the successfully printed message in the "Display Message" action. Obviously, you do not have the latest version of WinAutomation installed and this is why the characters are not sent properly in the notepad.

If you check the new help file under "What's new?", there is an entry:

Corrected: SendKeys action failed to send correctly the characters ~, %, ^, (, ), +, [ and ].

Please install the latest release of WinAutomation (3.0.2) and try again.

__________________

Error is not blindness, error is cowardice

__________________

Error is not blindness, error is cowardice

baz
User offline. Last seen 37 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 47
Re: Trying to input %postname%

Thanks Codex...the upgrade worked a treat and its working perfectly now.

codex
codex's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 161
Re: Trying to input %postname%

Glad that I could help! :-)

__________________

Error is not blindness, error is cowardice

__________________

Error is not blindness, error is cowardice