Combining string variables and numeric variables
Moderators: Dorian (MJT support), JRL
Combining string variables and numeric variables
I haven't been able to combine a string variable with a numeric variable, which I desperately need for automatic file saving. Any help with the following will be greatly appreciated.
press ALT
press Shift
press CTRL
send>s
release ALT
release Shift
release CTRL
wait>2
press Enter
waitwindowopen>Save Optimized As*
Let>SK_DELAY=10
Let>VAREXPLICIT=1
let>GroupName=C:\HfBooks\eBayPhotos\group-
let>GroupName=GroupName+%GroupNumber%
send>%GroupName%
press ALT
press Shift
press CTRL
send>s
release ALT
release Shift
release CTRL
wait>2
press Enter
waitwindowopen>Save Optimized As*
Let>SK_DELAY=10
Let>VAREXPLICIT=1
let>GroupName=C:\HfBooks\eBayPhotos\group-
let>GroupName=GroupName+%GroupNumber%
send>%GroupName%
Combining Variables
Didn't work. The result was:
C:\HfBooks\eBayPhotos\group-%GoupNumber%
Trying to get something that looks like this: C:\HfBooks\eBayPhotos\group-113, where the "113" is from the GroupNumber variable.
The code I used was this:
press ALT
press Shift
press CTRL
send>s
release ALT
release Shift
release CTRL
wait>2
press Enter
waitwindowopen>Save Optimized As*
Let>SK_DELAY=10
Let>VAREXPLICIT=1
let>GroupName=C:\HfBooks\eBayPhotos\group-
let>GroupName=%GroupName%%GroupNumber%
send>%GroupName%
C:\HfBooks\eBayPhotos\group-%GoupNumber%
Trying to get something that looks like this: C:\HfBooks\eBayPhotos\group-113, where the "113" is from the GroupNumber variable.
The code I used was this:
press ALT
press Shift
press CTRL
send>s
release ALT
release Shift
release CTRL
wait>2
press Enter
waitwindowopen>Save Optimized As*
Let>SK_DELAY=10
Let>VAREXPLICIT=1
let>GroupName=C:\HfBooks\eBayPhotos\group-
let>GroupName=%GroupName%%GroupNumber%
send>%GroupName%
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Is the "%GoupNumber%" typo in the forum or is the typo in your code?C:\HfBooks\eBayPhotos\group-%GoupNumber%
You don't explain how you're defining "GroupNumber" or what else may be happening to it between definition and use. When I have odd results like this I find it useful to plug in a MessageModal just ahead of where I want to use the variable so that I can temporarily see what variable's real value is.
press ALT
press Shift
press CTRL
send>s
release ALT
release Shift
release CTRL
wait>2
press Enter
waitwindowopen>Save Optimized As*
Let>SK_DELAY=10
Let>VAREXPLICIT=1
let>GroupName=C:\HfBooks\eBayPhotos\group-
MDL>%GroupNumber%
let>GroupName=%GroupName%%GroupNumber%
send>%GroupName%
Hope this is helpful,
Dick
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
No, a variable set in one macro is not visible in another unless you pass it to it. The Macro> command can be used to run another macro and you can pass a variable to it:
Macro>path\macrofile.scp /variablea=somevalue
Macro>path\macrofile.scp /variablea=somevalue
MJT Net Support
[email protected]
[email protected]
I am not having any luck at all with this, but I really appreciate all the help.
Let me back up here and describe what I am trying to do. I need to automatically create the path to save various photo files to my hard drive. The path will look something like this (with the variables I need to input in brackets): C:\HfBooks\eBayPhotos\group-[113]\[Poe]-[01].jpg.
The first variable, shown as "113" here, will remain the same for each work session. The second variable, shown as "Poe," will change a few times in each work session. The third variable, shown as "01," will change with each photo I save to disk.
The macro will NOT, however, be running throughout the entire process; rather, it will be started and ended for each photo. So I am looking for a way to automatically retrieve the correct group number (the "113" exampe), to automatically retrive the title (the "Poe" example) and to automatically increment the photo number (the "01" example).
Can you point me towards the code which will enable me to do this?
With abject apologies if I am testing your patience.
Let me back up here and describe what I am trying to do. I need to automatically create the path to save various photo files to my hard drive. The path will look something like this (with the variables I need to input in brackets): C:\HfBooks\eBayPhotos\group-[113]\[Poe]-[01].jpg.
The first variable, shown as "113" here, will remain the same for each work session. The second variable, shown as "Poe," will change a few times in each work session. The third variable, shown as "01," will change with each photo I save to disk.
The macro will NOT, however, be running throughout the entire process; rather, it will be started and ended for each photo. So I am looking for a way to automatically retrieve the correct group number (the "113" exampe), to automatically retrive the title (the "Poe" example) and to automatically increment the photo number (the "01" example).
Can you point me towards the code which will enable me to do this?
With abject apologies if I am testing your patience.
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
I think the best solution to this would be to use an .ini file to store the values between uses. There's a similar example here http://www.mjtnet.com/usergroup/viewtop ... ditinifile