Can variables be used with BaseElements plug-in?
Posted 07 February 2012 - 12:24 PM
I've been trying off and on for a week to pass filenames to the copy and move functions in the simple form:
BE_CopyFile ( $From ; $To)
BE_CopyFile and BE_MoveFile work fine when the filenames are literals (e.g., BE_CopyFile ( "C:\temp\file.txt" ; "C:\testdir\file.txt") )
But try as I might, I can't come up with a combination of text in variables that will be acted upon. And (frustratingly) the function only returns "?" on each and every combination ... which is absolutely no help in figuring anything out.
Goya (probably justifiably) doesn't offer any support for this free and open source offering, so there doesn't seem to be a way to pass this to them as a question. And, yes, I've read Goya's post on this forum regarding filename differences between Windows and Macs ... and the backslash issue, of course. But there's no mention of variables.
So I ask: has anyone deduced a workable format?
Thanks for any help.
Posted 17 February 2012 - 02:02 AM
Yes, it is possible to use variables with BaseElements. For example, the script steps
Set Variable[ $source; "C:\Users\brian.rich\Desktop\52-012-02.jpg"]
Set Variable[ $dest; "C:\Users\brian.rich\Desktop\52-012-03.jpg"]
Set Variable[ $result; BE_CopyFile ( $source; $dest)]
Pause/Resume Script [Indefinitely]
will copy the file 52-012-02.jpg on my desktop to 52-012-03.jpg
$result contains the value 0 after the script is executed - if the result is a ?, then this suggests there is a problem with the way that the plug-in is installed
I did run into a number of issues when the paths in variables or fields contained back-slashes - you may need to escape them thus C:\\temp\\file.txt to get the path correct.
Do you get the same problem with other BE commands?
Posted 17 February 2012 - 05:38 PM
It's a big step to have it confirmed that they should work. I can't imagine that the plug-in isn't installed properly because each command works with literals in the calls ... but each fails with variables. I'm aware of the back-slash issue ... although my experience is that I get it wrong more often than not. I'll go back over things with a fine-tooth comb ... and will use your desktop-to-desktop as a test template.
If Base Elements ever issues an update, maybe they'll incorporate an error return like "?<this is the call string>". Maybe?
Posted 22 February 2012 - 08:23 PM
Thanks again for the help.