Author |
Topic  |
|
kfauth
Germany
33 Posts |
Posted - 06/27/2016 : 11:36:42 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): Pro 2015G Sr2 Operating System:Win7Pro
Dear all,
somehow I am overlooking the obvious, I think. I have to process hundreds of ASCII files and would very much like to have this automatted.
The file names are long, though, and upon loading one into the active window (a worksheet, using 'open -w filename' ) the window name changes (to the filename, in principle), but it is being truncated.
So I would like to a) immediately rename the still active window (but I find no command for this) b) not have the window name changed in the first place.
Is this possible from a simple Labtalk script activated through klicking a button (text box)? |
Edited by - kfauth on 06/28/2016 03:24:32 AM |
|
Chris D
428 Posts |
|
kfauth
Germany
33 Posts |
Posted - 06/28/2016 : 01:22:35 AM
|
Thank you Chris.
I have been through these before. I am surprised that there are no more comprehensive docs. The examples mention the possibilities options.ImpMode:=3 and options.ImpMode:=4 but I am missing a comprehensive table of all values (what about 0..2 ?) and the detailed description of what happens.
Another example sais impasc has many options adn I'd like to see a kind of doc or manpage(s) where all options are systematically listed and their implications indicated.
I was unable to figure out how to avoid the renaming of the window that is being imported into. I tried options.Names.AutoNames:=0 but to no avail (again, I find no document which exactly sais what kind of auto-naming is concerned. That leads me to try-and-error kind of coding sessions more often than not and I don't consider this as time well-spent...)
OK , while ging back and forth to write this, I saw that I previously overlooked options.Names.FNameToBk:=0. That's what I'll try next. |
Edited by - kfauth on 06/28/2016 03:24:57 AM |
 |
|
kfauth
Germany
33 Posts |
Posted - 06/28/2016 : 03:29:12 AM
|
options.Names.FNameToBk:=0 indeed does the job. |
 |
|
nico_h
Germany
3 Posts |
Posted - 01/09/2018 : 06:27:20 AM
|
I'd also be interested in a way to rename the active worksheet without having to input the current name. That is hardly possible, when automatically processing many files. |
 |
|
Castiel
343 Posts |
Posted - 01/09/2018 : 9:00:41 PM
|
quote: Originally posted by nico_h
I'd also be interested in a way to rename the active worksheet without having to input the current name. That is hardly possible, when automatically processing many files.
The wks object refers to the active sheet (worksheet or matrix sheet) if no range is specified. To rename the active sheet using LabTalk, simply:
wks.name$="New Name"
#####
#### _\_ ________
##=-[.].]| \
#( _\ | |------|
# __| | ||||||||
\ _/ | ||||||||
.--'--'-. | | ____ |
/ __ `|__|[o__o]|
_(____nm_______ /____\____
|
 |
|
nico_h
Germany
3 Posts |
Posted - 01/10/2018 : 03:35:47 AM
|
Sorry, I made a mistake in my post. What I actually ment was "rename the active workBOOK". This is not possible in a similar way as renaming the active worksheet, because you have to input the current name. (Dont you?)
The way I accomplished it is: win -r %(page.name$) newname It works fine for me this way.
|
 |
|
Castiel
343 Posts |
Posted - 01/10/2018 : 04:55:31 AM
|
quote: Originally posted by nico_h
Sorry, I made a mistake in my post. What I actually ment was "rename the active workBOOK". This is not possible in a similar way as renaming the active worksheet, because you have to input the current name. (Dont you?)
The way I accomplished it is: win -r %(page.name$) newname It works fine for me this way.
You are right about it. That page.name$ is read-only is quite weird. If not comfortable with %(page.name$), have a try of %H
win -r %H newname %H is the name of the active window.
#####
#### _\_ ________
##=-[.].]| \
#( _\ | |------|
# __| | ||||||||
\ _/ | ||||||||
.--'--'-. | | ____ |
/ __ `|__|[o__o]|
_(____nm_______ /____\____
|
 |
|
nico_h
Germany
3 Posts |
Posted - 01/10/2018 : 06:55:31 AM
|
What makes you not comfortable with %(page.name$)? For me booth versions work so I can't figure out the difference.
page.name$ = short name %H = window title (=short name!?)
Edit: Just noticed that you wrote "If not comfortable". I read "I'm not ...". So don't mind the question.  |
Edited by - nico_h on 01/15/2018 02:44:05 AM |
 |
|
cpyang
USA
1406 Posts |
Posted - 01/10/2018 : 1:59:10 PM
|
Yes, %H and page.name$ are the same thing, just %H is easier to use.
They are both read only.
CP
|
 |
|
|
Topic  |
|