Many of my scripts are littered with “scrap = location” with scrap being defined as a String in the start of the script. I believe Mr. Ballman shared that little tip back in REAL Studio days on the NUG mail list.
It seems the problem is that the keyboard focus isn’t in the navigator (the class is grey, not blue) so its not picking up the class as the copy location and similarly when in the new project its pasting into the navigator search box rather than the navigator =\
[quote=371033:@]It seems the problem is that the keyboard focus isn’t in the navigator (the class is grey, not blue) so its not picking up the class as the copy location and similarly when in the new project its pasting into the navigator search box rather than the navigator =\
Would there be a way around that issue?[/quote]
Setting a variable to the “location” after you call SelectProjectItem() will do it (or does for me).
Right.
The “gray selection” disables the edit commands.
You only need to “blue select” any item before run your script or add a selectWindow(0) before the code (or select window by title)
selectWindow(0)
Dim ok As Boolean
ok = SelectProjectItem("Test")
If ok Then
dim dummy as string=location
DoCommand "Copy"
NewConsoleProject
DoCommand "Paste"
End If