javascript registered username ? SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
-
- User
- Posts: 5
- Joined: Tue Sep 15, 2020 3:50 pm
javascript registered username ?
Hi to everybody
New on this forum ans certainly newbie with the XCHANGE program, I need your help
I'm trying to create a dynamic stamp with the date/hour but also the name of the registered user.
I found an example of script using ...
((!identity.name || identity.loginName != (event.source.source || this).Collab.user) ? (event.source.source || this).Collab.user : identity.name)
but it gives the username of the windows session, that's not really explicit in my case (company policy)
Could you give me a script giving the first and last name of the registered user (= me!)
I understand that I could place my name directly in the text field, but would like something more portable
Thanks for your help
New on this forum ans certainly newbie with the XCHANGE program, I need your help
I'm trying to create a dynamic stamp with the date/hour but also the name of the registered user.
I found an example of script using ...
((!identity.name || identity.loginName != (event.source.source || this).Collab.user) ? (event.source.source || this).Collab.user : identity.name)
but it gives the username of the windows session, that's not really explicit in my case (company policy)
Could you give me a script giving the first and last name of the registered user (= me!)
I understand that I could place my name directly in the text field, but would like something more portable
Thanks for your help
- TrackerSupp-JohnG
- Site Admin
- Posts: 18
- Joined: Tue Sep 15, 2020 11:43 pm
Re: javascript registered username ?
Hello,
In order to use a dynamic stamp with the desired name, what you shall have to do is the following;
1) Select 'FILE>PREFERENCES>IDENTITY.'
2) Enter the name you wish to use in the name field.
3) Ensure that the box 'Get the information from the Active Directory' IS NOT checked.
Hope this helps you,
In order to use a dynamic stamp with the desired name, what you shall have to do is the following;
1) Select 'FILE>PREFERENCES>IDENTITY.'
2) Enter the name you wish to use in the name field.
3) Ensure that the box 'Get the information from the Active Directory' IS NOT checked.
Hope this helps you,
John Gareth
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
- User
- Posts: 5
- Joined: Tue Sep 15, 2020 3:50 pm
Re: javascript registered username ?
Thanks John ... indeed it's what I was searching for
could you give me an example of a script using all of these inputs ?
(name, company, dept, ...)
I'm a newbie in javascript and don't know anything about it
could you give me an example of a script using all of these inputs ?
(name, company, dept, ...)
I'm a newbie in javascript and don't know anything about it
- Tracker Supp-Stefan
- Site Admin
- Posts: 17818
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: javascript registered username ?
Hello there,
The script you have included in your initial post seems to be taking care of this.
If the name which John showed you is entered - it will be used (identity.name), and IF that is not set up - then the Windows username (identity.loginName) will be used instead as a fallback.
So that script you have should already work, and the use of the Windows user name is just a safety measure so that you can have a value to use if the identity.name has not been properly set up by the person using your script on their machine.
JS can be used to make changes to the identity.name value, as it is both Readable and Writeable, while the identity.loginName is a read only value.
Kind regards,
Stefan
The script you have included in your initial post seems to be taking care of this.
If the name which John showed you is entered - it will be used (identity.name), and IF that is not set up - then the Windows username (identity.loginName) will be used instead as a fallback.
So that script you have should already work, and the use of the Windows user name is just a safety measure so that you can have a value to use if the identity.name has not been properly set up by the person using your script on their machine.
JS can be used to make changes to the identity.name value, as it is both Readable and Writeable, while the identity.loginName is a read only value.
Kind regards,
Stefan
-
- User
- Posts: 5
- Joined: Tue Sep 15, 2020 3:50 pm
Re: javascript registered username ?
thanks for your reply, but I would like to user also other fields such as
- company name
- department
- email address
that I have entered in the fields that John ...
- company name
- department
- email address
that I have entered in the fields that John ...
- Tracker Supp-Stefan
- Site Admin
- Posts: 17818
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: javascript registered username ?
Hello there,
You have four properties under identity:
identity.name
identity.loginName
identity.corporation
identity.email
We can point you in the right direction but would not normally write the whole script for you, so if you want to use JS you are expected to have some knowledge yourself.
You can read more about the identity method and it's properties here (page 491):
https://www.adobe.com/content/dam/acom/ ... erence.pdf
Kind regards,
Stefan
You have four properties under identity:
identity.name
identity.loginName
identity.corporation
identity.email
We can point you in the right direction but would not normally write the whole script for you, so if you want to use JS you are expected to have some knowledge yourself.
You can read more about the identity method and it's properties here (page 491):
https://www.adobe.com/content/dam/acom/ ... erence.pdf
Kind regards,
Stefan
-
- User
- Posts: 5
- Joined: Tue Sep 15, 2020 3:50 pm
Re: javascript registered username ?
you're wonderful !
great, I found how to add all the fields that I need, to my stamp
just still searching the two last fields:
- title
- unit
great, I found how to add all the fields that I need, to my stamp
just still searching the two last fields:
- title
- unit
- Tracker Supp-Stefan
- Site Admin
- Posts: 17818
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: javascript registered username ?
Hello there,
I am afraid that
identity.unit
and
identity.title
are not described in the JS specification.
I spoke with the Project Leader for the Editor, and after he did some of his magic - we found out that there are two extra (undocumented) identity properties:
identity.title
and
identity.department (the "Organisation Unit" you see in the preferences window)
So we will be working on adding support for those two in a future build of the Editor as well.
#5327: Editor: Add JS support for identity.title and identity.department
Kind regards,
Stefan
I am afraid that
identity.unit
and
identity.title
are not described in the JS specification.
I spoke with the Project Leader for the Editor, and after he did some of his magic - we found out that there are two extra (undocumented) identity properties:
identity.title
and
identity.department (the "Organisation Unit" you see in the preferences window)
So we will be working on adding support for those two in a future build of the Editor as well.
#5327: Editor: Add JS support for identity.title and identity.department
Kind regards,
Stefan
-
- User
- Posts: 5
- Joined: Tue Sep 15, 2020 3:50 pm
Re: javascript registered username ? --> current file name? SOLVED
UPDATE :Hi'
I've another problem about dynamic stamps.
I would like to insert the file name of the document on which I put the dynamic stamp...
I searched on Google, and found ...
1) event.value = This.DocumentFileName, but when I put the stamp on a file, it gives the name of the "stamps ref files"
2) event.value = event.source.source || this.documentFileName , but gives something I don't understand (like "[Object Doc]")
Could you help me please ??
Thank you very much, and my best wishes for 2021
it works with
event.value = event.source.source.documentFileName.replace(/\.pdf$/i,"");
(giving the file name without the PDF extension)
- Tracker Supp-Stefan
- Site Admin
- Posts: 17818
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: javascript registered username ?
Hello Spam message posted by BOT engine - ignore - to be deleted by admin,
Many hanks for sharing this here! Hope it us useful to others as well!
Kind regards,
Stefan
Many hanks for sharing this here! Hope it us useful to others as well!
Kind regards,
Stefan