Place a USER name in a box?

I am trying to add a user name in a box so never saves the last file it there place name in the box that you press save button.  I'll post the code I am using below.  as well as a pic to show what I am wanting.

#targetengine "myUniqueName".

Add an event listener for the beforeSave event ' ' what is the execution of a function

app.addEventListener

(

/ event you are listening to. As String * / "beforeSave",.

/ Act which is called when it is recognized: * / doTextFrameOnPageOne

);

function doTextFrameOnPageOne()

{/ * THIS IS WHERE SHOULD I PLACE THE CODE BELOW? * /}

Here you will start your code, that is:

// 1. Looking for the username

// 2. Check, if you want to create the text frame is already here

// 3. Adds the user name, the current date and some other information

// 4. Tells the document where exactly to put the block of text, dimensions and other properties

Test the function:

Alert ("event fired \"beforeSave\"juste.");

};

SHOULD this CODE GO in THE FUNCTION between PARENTHESES above?

var myString = "Hello InDesign" + app.version + "," + getUser() + '.';

alert (myString);

getUser() {} function

VAR myUser = ($.os .substring (0, 7) == "Windows") / / I USE a MAC SO DO I JUST REPLACE "Windows" with "MAC".  ALSO I WANT TO ENTER THE NAME OF INDESIGN USER NOT THE COMPUTER * IF POSSIBLE *.

? $.getenv ("USERNAME")

: $.getenv ("user");

return of myUser;

}

Hello

I wouldn't work with text customized for all variables.

With a mechanism just listen to ordinary event.

Addition and update of information in the text frame will be done whenever the user saves the document with the Save"" command.

For a demonstration, I recorded a video clip, you can download from my Dropbox here account:

Dropbox - beforeSave - doTextFrameOnPageOne.mov

The code I used is below.

Customize to your needs.

E.g. Add the text frame on a master page, if you want on each page where the master is applied.

Name of the image as you want. If you use several frames you will need to loop through all occurrences of the frame if you make duplicates.

Change the position of the image, change the content to your needs, color of the frame, the size of the text, etc.pp.

Here is the code base for the addition and update of a block of text on the page of a document whenever the command 'save' is executed by the user:

// beforeSave-doTextFrameOnPageOne.jsx
// Uwe Laubender

/**
* @@@BUILDINFO@@@ beforeSave-doTextFrameOnPageOne.jsx !Version! Thu May 19 2016 09:22:13 GMT+0200
*/

#targetengine "chooseReasonableNameHere"

app.addEventListener( "beforeSave" , doTextFrameOnPageOne );

function doTextFrameOnPageOne()
{

    var frameName = "Temp";
    var doc = app.documents[0];
    var tempFrame = doc.textFrames.itemByName(frameName);

    var contentsOfFrame =
        doc.name+"\r"+
        getLogInUserName() +"\r"+
        getLocaleDateString() +"\r"+
        getAppUserName();

    // Change the propeties to your needs:
    var tempFrameProperties =
    {
        name : frameName ,
        contents : contentsOfFrame ,
        fillColor : "Yellow" ,
        geometricBounds : [0,0,"50mm","50mm"]
    }

    if(!tempFrame.isValid)
    {
        var tempFrame = doc.pages[0].textFrames.add();
        tempFrame.properties = tempFrameProperties;
    };

    tempFrame.contents = contentsOfFrame;

}

function getLogInUserName()
{

    var userNameOSX = $.getenv("USER");
    var userNameWindows = $.getenv("USERNAME");

    if(userNameWindows == null){return userNameOSX}
    else{return userNameWindows};

}

function getAppUserName()
{
    return app.userName;
}

function getLocaleDateString()
{
    return new Date().toLocaleString();
}

Important notes:

1 if the document is not saved at all, and save you the first time, the event is not raised.

2. If you test the script and that you want to make changes and run the script again, quit and restart InDesign

I don't have test intensively. All tests are performed with InDesign CS6 v8.1.0 on Mac OSX 10.10.3.

3. If the script is placed in a startup scripts folder, the script will be automatically activated after that InDesign is started and is active when you exit InDesign.

4. If the script is run from the Scripts Panel of InDesign it will be active until you exit InDesign.

Hope, that helps.

Uwe

Tags: InDesign

Similar Questions

  • inadvertently omitted the box "stay signed in on" checked. Now, my user name always appears automatically. Don't want him! Also want to leave that box unchecked unavailability

    Using FF; Windows 7:
    (1) I'm NOT tech-oriented and I indavertently left the box "stay signed in on" checked. Now my user name always appears automatically and I don't want him, but I can't find how to fix it ANYWHERE.
    (2) how can I keep that box "stay signed in on" disabled permanently.
    (3) before coming to this page, there is a page that asked me my e-mail address, etc.. He said that the email was already in use. No kidding; This is me. He was trying to create a new account, so I finally just used another email address & implemented a new.

    A detail as a website to remember you (automatically log you) is stored in a cookie.

    You can use these steps to make a Web site recognize and remember you:

    • Create a cookie 'allow' except to keep these cookies, in particular in the case of secure websites and when the cookies expire when Firefox is closed.
    • Tools > Options > privacy > "Use the custom settings for history" > Cookies: Exceptions

    You can delete cookies for a Web site to make the site forget about you.
    'Delete Cookies' sites causing problems:

    • Firefox/tools > Options > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".
  • How can I keep a wrong user name to come up with a click on the box?

    I typed an incorrect username. Now, when I click on the user name box to display my username, it displays the wrong name as a choice, but I don't want to show. Is it possible to remove this name?

    Follow these steps to delete the recorded data (form) in a drop-down list:

    1. Click on the (empty) input field on the web page to open the drop-down list
    2. Select an entry in the drop-down list
    3. Press the DELETE key (on a Mac: shift + delete) to remove it.
  • I can not access my Verizon email on my iPad. I can access the login page, but there is no box to enter the user name. I talked to Verizon support, and they say no problem at their end. Any ideas?

    I can not access my Verizon email on my iPad. I can access the login page, but there is no box to enter the user name. I talked to Verizon support, and they say no problem at their end. Any ideas?

    Macbeth,

    From your description, it appears you are trying to get your mail using Safari to access your e-mail account. Why you do not use the Mail App?

    http://www.Verizon.com/cs/groups/public/documents/adacct/Setup-email-mobile-Devi Ed.pdf

  • I'm trying to access my work PC to remote my PC at home. The box says Windows 2000 Server and I do not know where to find my user name or password

    Original title: Windows 2000 server

    Search results for "I try to access my work PC to remote my PC at home. I need to get through my credentials and don't know where to find the information. The box says Windows 2000 Server and I do not know where to find my user name or password. The one I use to log into my work PC or PC at home do not work. »

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • When I open Windows Mail, I get a box asking my user name and password every time.

    WHEN I OPEN WINDOWS MAIL, I GET A BOX ASKING MY PASSWORD USER NAME X.  To BE HONEST it WAS A LONG TIME ago X I remember EITHER. I TRIED ALL THE NAMES THAT I WOULD USE NORMALLY, BUT IN VAIN. IS THERE A WAY TO OVERCOME THIS OBSTACLE, OR CAN I RESET BOTH. I DON'T SEE ANY OPTION ON THE SCREEN TO DO SO.

    JOHN KILLEN

    original title: WINDOWS MAIL ask AGAIN ME to LOG ON BEFORE I CAN ACESS MY emails. I TRIED EVERY USERNAME X WORD OF PAST BUT THE LOG ON BOX APPEARS AGAIN. HOW CAN I WORK AROUND THIS OR EVEN X USERNAME PASSWORD RESET

    Contact your ISP/mail server. They know your password.

  • Windows 7 Home Premium - cannot change the user name in the authentication dialog box

    I was hoping someone might be able to answer a question on how to get a computer running Windows 7 Home Premium to display both the username and password fields when attempting to authenticate on another Windows computer.

    Here's the situation: allow us that the leaders and other members of the staff allowed our Organization to establish a VPN connection to our corporate network (via Fortinet Forticlient, for what it's worth.)  Once the VPN connection is established, on the remote computer, the user must be able to access the UNC path to our file (\\servername\share) server.

    Because the remote user has not yet authenticated on the domain Active Directory of business, a dialog box should appear to the user input a user name and password.  Enter the user name (domain\username) and password and share should open, and the user must then be able to access the files in the share.

    I (and several other members of the staff) have been using this method successfully to access files via the VPN connection, and it works very well.  However, it does not work whenever the President of the company will connect to the VPN from his computer at home.

    Whenever the President connects the VPN and attempts to access the UNC path, he reports that the dialog box which appears on his computer at home has only one field for a password; the user name field appears to be on his local user account, and it doesn't have the ability to change.  (I have him asked if there is an option 'use authentication information', and he declares that there is not just a dialog box with a single field, the field of password.)

    The President is running Windows 7 Home Premium on his computer at home, so I thought that the problem could be because he was running this edition of Windows.  However, I have installed VPN client and test the connection on the server share file using the computer of my wife, who is also running Windows 7 Home Premium, and I received the two fields as expected authentication dialog box and has been able to authenticate to the domain successfully and open files from the share with no problems.

    Does anyone have recommendations on what I can try to allow the President to authenticate successfully to our server share?  I am confused, and it is eager to be able to get remote access to files on his home computer.

    Hello

    Please contact Microsoft Community.

    I suggest you to ask your question in the Technet Forums, where we are the support technicians who are well equipped with the knowledge on these issues. Please visit the following link to go to them and post your query there:

    https://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w7itpro

    Have a great day.

  • autologin Windows 7 without box "users must enter a user name and password to use this computer"

    My dialog box user accounts does not the box "users must enter a user name and password to use this computer" and how do I turn it on?

    Hello Russ,

    You can continue with the following steps to support.  However, if your computer is on a domain, unfortunately, there's nothing we can do.  You will need to contact the system/network administrator.  TechNet forums can be beneficial for a resolution on your http://social.technet.microsoft.com/Forums/en-us/category/w7itproinquiry.  Please create a Restore Point and backup of the registry before proceeding.

    1. click on start, run, type regedit, and then click OK.
    2. look for the following registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon
    3. with the help of your account name and password, double-click the DefaultUserName entry, type your user name, and then click OK.
    4. double-click the DefaultPassword entry, type your password in the value data box, and then click OK.

    If there is no DefaultPassword value, create the value. To do this, follow these steps: a. in the registry editor, click on edit, click New, and then click String value.
    b. Type DefaultPassword as the value name, and press ENTER.
    c. double-click the newly created key, and then type your password in the value data box.
    If no DefaultPassword string is specified, Windows XP automatically changes the value of the AutoAdminLogon registry key by replacing 1 (true) to 0 (false) to turn off the AutoAdminLogon feature.
    5 double-click the AutoAdminLogon entry, type 1 in the value data box, and then click OK.

    If there is no AutoAdminLogon entry, create the entry. To do this, follow these steps: a. in the registry editor, click on edit, click New, and then click String value.
    b. type AutoAdminLogon as the value name, and press ENTER.
    c. double-click the newly created key, and then type 1 in the value data box.
     
    6. exit the registry editor.
    7. click on start, click on restart and then click OK.

    I hope that this information is beneficial

    Thank you

    Aaron
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Username, preserved in the AnyConnect Client user name dialog box

    I have one question remains on my client anyconnect 2.5.2006. The user in the dialog box name is cached. We do not want to be cached and have users to enter their username every time.

    Shilpa Gupta mentioned on another post of mine. I was wondering if anyone has any other thoughts! The 2.5.2006 resolved customer I had another question, so come back to 2.4 is not an option at this point.

    For clearing up the credentials in the dialog box when using AnyConnect I found one of the bug:-

    CSCsx76993

    Symptom:

    User credentials are cached in the preferences.xml file when you use the Anyconnect client.  So when they revive Anyconnect, the user name is displayed in the client.

    Conditions:

    You can see all the client anyconnect.  It is a configurable option in the IPSec client.

    Workaround solution:

    Currently there is no work around

    And I can see it resolved in 2.4.202 however, I'm not sure if its fixed in 2.5 also. For this I would like to hear from others.

    Kind regards

    Shilpa

    Hello

    All bug fixes and new features in 2.4.x are also in 2.5.

    However the "bug" Shilpa has pointed out, is not really a bug, but an enhancement request, in other words in 2.3 before the cached username is expected behavior and is always the default behavior in the 'fixed' versions, so just the upgrade won't change anything. What has changed is that now you can change the behavior by defining a new parameter RestrictPreferenceCaching in the local policy file:

    http://www.Cisco.com/en/us/docs/security/vpn_client/AnyConnect/anyconnect25/Administration/Guide/ac04localpolicy.html#wp1055429

    So for example the addition

        All

    your local police should achieve what you want.

    HTH

    Herbert

  • Hello, I was wondering: the FTP box fill, what should I type here for example: what user name? My username from my Web host? Or the username of Muse? Advice would be really appreciated - thanks in advance!

    Hello, I was wondering: the FTP box fill, what should I type here for example: what user name? My username from my Web host? Or the username of Muse? Advice would be really appreciated - thanks in advance!

    This would be information provided by your hosting provider.

  • Get a pop-up box 'Please indicate the password and user name for Proxy server"...

    Get a pop-up box 'Please indicate the password and user name for Proxy server"...

    I don't know what to do... Please help.

    Hi G-R-O-C-K,.

    Looks like you're behind a limited connection / network.

    These are the entries, you need to add:

    https://na1mbls.licenses.Adobe.com

    https://IMS-NA1.adobelogin.com

    https://adobeid-NA1.Services.Adobe.com

    https://na1r.Services.Adobe.com

    http://activate.Adobe.com

    https://activate.Adobe.com

    http://Adobe.activate.com

    https://Adobe.activate.com

    ccmdls.Adobe.com:443

    IMS - na1.adobelogin.com:443na1r.services.adobe.com:443prod - rel - ffc - ccm.oobesaas.adobe.com:443

    LM.licenses.adobe.com:443

    www-DU1.adobe.com

    When you try to connect to WIFI, try connecting with a cable and see if you get the same.

    Otherwise, see: https://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    Hope this helps you solve the problem.

    Kind regards

    Harrie

  • How the prefix newly entered in a text box text user name and timestamp

    APEX newbie uses version 4.0.1 and Oracle XE on laptop to develop the app before implementing into production...

    Have had an input text box field that users will update with progress i.e text on a topic, for example.

    Now, I want to put the user name and the timestamp as a prefix to any text that the user adds to the text box.

    Must I do this via Javascript on the client and if so, am not entirely sure how?

    Or should I leave Oracle adds the: APP_USER and a timestamp when the user saves its data in the database?
    Once again how I am doing as I think I would need store the initial text in the textarea somewhere on the loading of the page and then when save or apply button compare the
    Orig and modified and prefix text box text newly added with user name and timestamp before sending it to Oracle to save?

    Apologies if I made a meal of this... It seems a reasonable think to want to be able to do I think?

    Any help is very appreciated as always.

    Thank you.

    A correction, you must use the keyword CURRENT_TIMESTAMP to get the correct timestamp:

    : APP_USR | ' - ' || CURRENT_TIMESTAMP | ' - ' || : P1_TEXT_AREA

  • Cannot change the user name of the forum

    If you go to the user control panel, under the profile box, there is a place where we can make our forum user name - which would be nice because this stuff USER-xyz is ridiculous.

    Unfortunately, it does not work because you must put a valid e-mail address in order to change your user name... but you can't because it lacks the text box that you are supposed to type in the e-mail address field.

    Can a mod contact someone who can take a look at this?

    I too have this problem. I really wish that Sony would like to address this forum some to make it easier to use.

  • TestStand user names

    Hello

    I would like to know where the user names and passwords are stored in teststand, so that I can copy the same file to a version update of teststand.

    It's just to know.

    Thank you

    Krishna

    Hey Krishna,.

    They are stored in the file Users.ini.  It is located in the directory Cfg in your folder TestStand.  So, something like this: C:\Program NIUninstaller Instruments\TestStand 4.1.1\Cfg.  They changed the Cfg folder location in recent versions of TS.  In addition, the recently changed to a txt file in a binary file, so I don't know how portable it will take place from older versions to the latest.

    TS, you can go to configure > Station Options.  Then click User Manager.  Uncheck the default box, and find the old Users.ini file.  If it works, then you can remove the old one and hover over another in the Cfg folder.  Then recheck the default zone.

    We have a Users.ini file on a shared drive and point to it all our test stations.  Then, we can just edit this shared copy and all stations to see.

    Hope this helps,

  • My opening of user account and profile my c: drive user names do not match. Multiple user profiles.

    RE: Vista Home Premium 32 bit W/sp2 installed. FYI - recently got a new hard drive and a new installation of the Vista operating system.

    I'll try to keep this as simple as I can, so bear with me. I have my c: drive under users 4 ads, which contain the normal operating system files. My guest account is disabled. I am the admin on the admin account, which is the only active account running at the moment. I deleted an administrator account and a user account standard and kept my 1 active admin account. I wish that were the only account on this computer as I'm the only one to use it in the future. Profiles are always on my c: drive and I would like to delete and rename my admin account to show as such. I changed my admin account name and thought I would just remove all from drive c: under users.except my account. My account name is easy to change but the profile on the disc is the former name of admin account and there is no option to change. When I open windows Explorer to my documents folder the name changed to the new name. When searching in each profile, I find that the folders and files I added are all in the old profile folder and partially in the new profile. Some are just empty and they appear in the other. Its a dam mess! How, or can I combine all my folders and files under just the profile of a user that will be used? I thought I would copy everything from the old to the new admin account, but windows will recognize even these files under a new account name? I'm also afraid to change my password to prevent implementing locked out my own computer. I read all kinds of horror stories on the web about it. How can something seemingly so simple be such a Pandora's box. I have not deleted anything yet but profiles of user accounts. Now my system is stable and works very well. No problem to speak of, but as time go on and Add / Remove programs and move things around I'll never know where to find anything. I would like to put something in its place and be there when I need it. I think that there may be problems with the standard accounts and admin / permissions or something but I do not have the ability to copy or to move things and losing important data, until I hear something concrete. I hope someone can help and thank you.

    As always - changing the user name does not change the name of the folder.  If you want to get the name of the folder and the user name corresponds to-creating a new user with the name that you want to name the user name and the folder and copy the data you want to keep the new user.  Then delete the old user and all files/folders via the user control panel.

    Really - * you * is the realization of a complicated.

    (1) create the * new * user account from scratch with the username you want.  This will make the user name and the corresponding folder.  (Of course - you may need to change the username on a current user if t ever get the one you want first.)

    (2) copy the Documents, photos, etc. you want from the old account to the new.

    (3) via the user control panel, remove whatever you do not want users.  Don't do this manually.  You have no reason to go in the C:\USERS\ yourself.  If you do, * you * are causing you pain.

    (4) you do really want two administrative level accounts in case you lose access to the other.  It's just the wise thing to do.

    Windows 7 is a multi-user system - even if you are the only physical user.

Maybe you are looking for