[script] smbfs-reset

I had this problem that when I was restarting my Windows machine, my smbfs shares were unusable and couldn't be easily remounted. So I made this little script which does it in a rather brutal, yet working way.
Hope you'll find it useful.
#!/bin/bash
# Make sure we are running under root
if [ ! `whoami` = "root" ]; then
echo "You need root priviliges to run this script."
exit
fi
# Gets the bad mount points
BAD_MOUNT_POINTS=`cat /etc/mtab | grep smbfs | awk ' {print $2} '`
# Delete the bad entries from /etc/mtab
sed -i '/^.* smbfs .*$/ d' /etc/mtab
# remount the bad mounts
for i in $BAD_MOUNT_POINTS; do
umount -l $i
mount $i
done
echo "Mounts were reset successfully."
Enjoy.

Thanks for this script!
What needs to be done to convert a .jsx into an .exe executable that I can add to the RH Toolbox (pod) and run it in a project on my terms, rather than import into the project so it runs (whenever I compile?)
What is the ReSize tool for that already exists in the toolbox?

Similar Messages

  • Error when running script to reset size - bad argument gettokenmanager

    Hello,
    I use RoboHelp HTML 8 (currently on 8.0.2.208) and have a project with a number of user interface images that are going to be translated. The translated images will likely be of different size, so I need to have a fast way of reseting all the image sizes in my project.
    I discovered Chasnikov's script "reset all images" on the thread:
    http://forums.adobe.com/message/2128583#2128583
    which seems just perfect for my situation.
    Not wanting to test this on my real project, I made a copy in a different location and tested out the script. The script ran for a while, but then abruptly ended with the following message:
    Bad argument getTokenManager
    In looking at the output window it seemed like it stopped in the middle of a topic after going through a number of topics. For my test situation, I only replaced a few graphics in a few topics and when I checked this limited sample, they all seemed to be correctly resized.
    However, my concern is that if I use this script in my real project, it won't actually resize all of the images.
    Any ideas why the script is terminating abruptly?
    By the way, I did find a similar question about this error message in the thread http://forums.adobe.com/message/2551147
    however, the solution to add the line msg(filepath); to the script resulted in another error -- RH did not recognize 'msg' as a valid command.
    Thanks, Rose

    Thanks Willam for the advice. In the meantime I realized that there was something wrong with my project--because the word count script also gave me the same error message -- so I ran it on another version of the project and it was just fine.
    There are two questions that your response brings to mind:
    1. How are you able to see the line numbers in the script?  When I edit the script, it opens in Notepad and I can't turn on line numbers. I have discovered, that if I have word wrap off, I can use Goto and specifiy a line number to go to.  Are you using a different text editor?
    2. The reset size script doesn't announce that it is finished.  It just seems to stop displaying things in the output window, but it doesn't give me a message to say it has finished.  Can you recommend some code I could add to the reset size script to output that it has finished processing sucessfully?
    Thanks in advance.
    Rose

  • Needed simple script to reset multiple images to 100%

    I don't know if this is the right place to ask, but I cannot find such a script anywhere: what I want is to reset the size of multiple selected images back to 100%.
    Looks like such a simple and needed function is not included in InDesign CS3...
    (MacBook Pro, Indesign CS3).

    "codevar" at the start oughta be just "var".
    "idx[idx]." oughtta be "sel[idx]." -- twice.
    Otherwise (untested) it seems it should work.
    Harbs, was this sent by e-mail? I've been having flowers weird problems lately, trying to format something as quote or code with the flowers Jive web editor. Some flowers line of flowers java keeps popping up -- using IE 8, latest flowers update.

  • Script to "Reset size" for all images in a RoboHelp project

    New UI. Quick fix to pull new screenshots is hampered by the size constraints of graphics.
    Is there a (third party or built in) script that will reset size for all the images in a RoboHelp HTML project?
    RH8, RoboHelpHTML bulished as WebHelp.
    PS the filter in Adobe Forums doesn't allow me to limit the search to RoboHelp HTML and WebHelp; I don't have any other Adobe products, so all the hits don't apply.

    Thanks for this script!
    What needs to be done to convert a .jsx into an .exe executable that I can add to the RH Toolbox (pod) and run it in a project on my terms, rather than import into the project so it runs (whenever I compile?)
    What is the ReSize tool for that already exists in the toolbox?

  • Missing data_file when copying PROD to TEST due to script to reset instance

    Newbie DBA, We have got a financial application that uses oracle DB, and a script has been developed to run whenever a copy of the PROD is migrated to TEST to reset the datafiles, but the scripts runs on the datafiles that came with the application, I have created some new datafiles but don't know how add them to the script.
    A copy of the script is below but i don't know how the DEFINE DBDATA2=D:\&ODAT came about, Please advise
    WHENEVER SQLERROR EXIT 1
    WHENEVER OSERROR EXIT 2
    SET VER OFF
    DEFINE OSID=TEST
    DEFINE ODAT=oracle\oradata\&OSID
    DEFINE DBDATA1=D:\&ODAT
    DEFINE DBDATA2=D:\&ODAT
    DEFINE DBDATA3=D:\&ODAT
    DEFINE DBDATA4=D:\&ODAT
    SPOOL &2
    WHENEVER OSERROR CONTINUE
    connect &1
    WHENEVER OSERROR EXIT 2
    STARTUP NOMOUNT
    CREATE CONTROLFILE REUSE SET DATABASE "&OSID" RESETLOGS NOARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 4
    MAXDATAFILES 1022
    MAXINSTANCES 1
    MAXLOGHISTORY 0
    LOGFILE
    GROUP 1
    ('&DBDATA2.\redo0101.log',
    '&DBDATA3.\redo0102.log') SIZE 50M,
    GROUP 2
    ('&DBDATA2.\redo0201.log',
    '&DBDATA3.\redo0202.log') SIZE 50M,
    GROUP 3
    ('&DBDATA2.\redo0301.log',
    '&DBDATA3.\redo0302.log') SIZE 50M,
    GROUP 4
    ('&DBDATA2.\redo0401.log',
    '&DBDATA3.\redo0402.log') SIZE 50M
    DATAFILE
    '&DBDATA1.\system01.dbf',
    '&DBDATA4.\undo01.dbf',
    '&DBDATA2.\scdat01.dbf',
    '&DBDATA2.\scdat02.dbf',
    '&DBDATA2.\scdat03.dbf',
    '&DBDATA2.\scdat04.dbf',
    '&DBDATA2.\scdat05.dbf',
    '&DBDATA3.\scindx01.dbf',
    '&DBDATA3.\scindx02.dbf',
    '&DBDATA3.\scindx03.dbf',
    '&DBDATA3.\scindx04.dbf',
    '&DBDATA3.\scindx05.dbf',
    '&DBDATA4.\scaudit01.dbf',
    '&DBDATA4.\scaudit02.dbf',
    '&DBDATA4.\scaudit03.dbf',

    You can add your data files at the end of the DATAFILE in your script
    if the file created are at locations DEFINE DBDATA1=D:\&ODAT
    DEFINE DBDATA2=D:\&ODAT
    DEFINE DBDATA3=D:\&ODAT
    DEFINE DBDATA4=D:\&ODAT
    else add one more varaible as above and add the new files to the script

  • Script to reset factory defaults on multple routers

    Hi All,
    We have a number of routers and switches that need to reset to factory defaults the devices have been locked out with security (U/N and P/W are unavailable). A Terminal server has been configured with 2 X NM-16A with the octal cables and connectivity is working.
    Can you please provide an example of a script which will send the CTRL Break signal during bootup while connected via terminal server to the devices using a octal cables (serial console connection) or is there a utlity to connect to multiple devices and reset the factory default settings. We have literally hundreds of devices to reset.
    Look forward to your response.
    BR,
    Jay
    07818 418 147

    Well my problem... wait I thought I described it...
    Every week it's like my DHCP goes out of wake and cuts off ip distro on my network causing all LAN and wireless connections to have a yellow exclamation on there network devices... no amount of power resets will fix it ... only a restore factory default on the router itself will bring back everyone online.

  • Calling script to reset NTFS acl by mouse right-click... Possible???

    hello
    One subfolder have name as domain account name, like mikesmith...I want to right click on folder and choose example "reset ntfs". this "reset ntfs" is menu under right click which call script. this script need to disable inheritance,
    grant modify access to this user AUTOMATICALLY (from name of folder) and full to admin, auditing bla bla and rest all child object...
    Is that possible?

    Hi,
    Actually it is 2 questions. a. Add an item to Right Click menu and b. a script to help create default permission.
    Add an item to right click menu should be easy, however it is difficult to tell the script the "current location" (the path of the folder you right-clicked) and run the script on that folder specifically.
    Thus I think we could find another way to get this purpose.
    From the description it seems like creating home folders for users - folder with user name and only Admins and that specific user have permission to access.
    Generally we will directly use Home Folders function to do this. During my research it seems that the following script is more suitable for creating such folders in batch:
    https://gallery.technet.microsoft.com/scriptcenter/How-to-create-home-folder-d968f1d4
    It could help create folders for user accounts you input in TXT files in batch and only the user and Admins will have Full Control permission. 
    If you have any feedback on our support, please send to [email protected]

  • Modify a script to reset fields selectively in a multiform document

    The enclosed script allows to clear forms selectively page by page in a multiform document.
    But the script is very limited because asks to change in each page where is inserted a new page number for the «resetFieldsOnpage(n) variable.
    In a 100 pages document it is a a non-sense task, involving many steps:
    go to page
    touch the clear field
    right mouse /properties
    choose actions
    select run a java script
    edit the Java script
    now change the number page
    close
    Perhaps it is possible to have a real script assigned to the same field (duplicated in all pages) that allows Acrobat understands that the button used is related to a specific page and the clearing will only affect that one.
    Thanks.
    function resetFieldsOnPage(p) {
        var fields = [];
        for (var i=0; i<this.numFields; i++) {
            var f = this.getField(this.getNthFieldName(i));
            if (f==null) continue;
            if (f.page==p)
                fields.push(f.name);
        this.resetForm(fields);
    resetFieldsOnPage(0);

    Hi, good point.
    But, before, something happened here.
    When I was testing the script and using it , immediately opens the script debugger window with a lot of stacks and info!
    The form process is stopped.

  • Reset monitors all at once with a script

    I am getting numerous SCOM Heath Monitor alerts for the following 2 conditions:
    AD Domain Availability Health Degraded
    AD Site Availability Health Degraded
    I have searched the internet for scripts to reset them each all at once. I have found a couple of scripts and ran them in the SCOM Shell and they say that that are resetting the alerts but in actuality, they don't.
    The scripts I used were found at these 2 sites:
    (url)http://blogs.technet.com/b/ken_brumfield/archive/2010/06/23/making-the-world-greener-one-monitor-at-a-time-_2d00_-reset-scom-monitors-enmasse.aspx(/url)
    (url)http://gallery.technet.microsoft.com/SCOM-2012-Batch-reset-63a17534(/url)
    Does anyone know of a script that actually works for this purpose.

    Use this simple PS, I am using this daily to reset health of closed alerts - please ensure you close the alerts as the script will only detect the closed alerts generated by the monitors
    Works well for my purpose - hope this helps...
    #PS to reset health of closed alerts generated by the monitors older than 7 days
    # Import Operations Manager Module and create Connection 
    Import-Module OperationsManager 
    New-SCOMManagementGroupConnection 
    $alerts=get-scomalert -Criteria "Severity!=0 AND IsMonitorAlert=1 AND ResolutionState=255"| where {$_.LastModified -ge ((get-date).AddDays(-7)).ToUniversalTime()} 
    if ($alerts -is [object]) 
    foreach ($alert in $alerts) 
    $monitoringobject = Get-SCOMClassinstance -id $alert.MonitoringObjectId 
    # Reset Monitor 
    If (($monitoringobject.HealthState -eq "Error") -or ($monitoringobject.HealthState -eq "Warning")) 
    $monitoringobject.ResetMonitoringState() 
    Faizan

  • UBR EEM script resetting the modem

    Hello,
    I'm trying to find a way to perform some action on cable modem basing on syslog event. Let's take an example: I'm getting the following message in the syslog:
    %UBR10000-5-UNREGSIDTIMEOUT: CMTS deleted unregistered Cable Modem XXXX.YYYY.ZZZZ
    Now, I'd like the script to reset this modem when such event occurs (maybe it makes no sense to reset deleted modem but it's only example)
    And now I'm looking for the way, how to use the event syslog message in the script and how to extract the MAC address of the modem from this line.
    Being specific - how to get $MAC variable, having in mind that there's no regexp command on UBR IOS?
    event manager applet modem_reset
     event syslog occurs 1 pattern "CMTS deleted unregistered Cable Modem" period 1
     action 1 cli command "clear cable modem $MAC reset"
    BR,
    Andrzej

    Hello, Joseph,
    Thanks a lot for your reply. I have followed your advice and prepare an example script, however I have an issue with extracting particular substring. This is the first time I'm fighting with TCL scripts so sorry my ignorance. Please, could you look at this and let me know what could be wrong here:
    U10k#sh run | sec event
    event manager environment sub4
    event manager directory user policy "disk0:/"
    event manager session cli username "user"
    event manager applet config
    event syslog occurs 1 pattern "Configured from" period 1
    action 1 cli command "type $_syslog_msg | append disk0:conf_log"
    action 2 cli command "show cable modem | append disk0:conf_log"
    action 3 policy tcl.tcl
    event manager policy tcl.tcl type user
    U10k#
    U10k#
    U10k#
    U10k#
    U10k#more disk0:tcl.tcl
    ::cisco::eem::event_register_syslog occurs 1 pattern {Configured from} period 1
    # This EEM tcl policy was generated by the EEM applet conversion
    # utility at http://www.marcuscom.com/convert_applet/
    # using the following applet:
    # event manager applet config
    # event syslog occurs 1 pattern "Configured from" period 1
    # action 1 regexp "from console by [A-Za-z] on" $_syslog_msg user sub1 sub2 sub3 sub4
    # action 2 syslog msg "Configuration changed by $sub4"
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set arr_einfo [event_reqinfo]
    set _regexp_result [regexp {from console by [A-Za-z] on} $arr_einfo(msg) user sub1 sub2 sub3 sub4]
    action_syslog msg "Configuration changed by $sub4"
    U10k#
    U10k#
    U10k#
    U10k#
    U10k#clear logging
    Clear logging buffer [confirm]
    U10k#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    U10k(config)#int gig
    U10k(config)#int gigabitEthernet 1/0/2
    U10k(config-if)#shu
    U10k(config-if)#shutdown
    U10k(config-if)#no shu
    U10k(config-if)#no shutdown
    U10k(config-if)#exit
    U10k(config)#exit
    U10k#sh
    U10k#show logg
    U10k#show logging
    Syslog logging: enabled (0 messages dropped, 781 messages rate-limited, 5 flushes, 0 overruns, xml disabled, filtering disabled)
    No Active Message Discriminator.
    No Inactive Message Discriminator.
    Console logging: level debugging, 500 messages logged, xml disabled,
    filtering disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
    filtering disabled
    Buffer logging: level informational, 1225 messages logged, xml disabled,
    filtering disabled
    Exception Logging: size (4096 bytes)
    Count and timestamp logging messages: disabled
    Persistent logging: disabled
    Trap logging: level informational, 1230 message lines logged
    Log Buffer (131072 bytes):
    001264: Feb 19 11:39:06.647 GMT+1: %SYS-5-CONFIG_I: Configured from console by klonex on vty1 (192.168.101.197)
    001265: Feb 19 11:39:06.787 GMT+1: %HA_EM-6-LOG: tmpsys:/eem_policy/tcl.tcl: Configuration changed by
    001266: Feb 19 11:39:07.167 GMT+1: %HA_EM-3-FMPD_ERROR: Error executing applet config statement 3
    BR,
    Andrzej

  • Reset the form to Null or Reload the page using reset even after a submit

    Hi ,
    This is the scenario:
    I have two button - Submit and Reset
    Submit is used for validation and after validation is passed it passes it to another form to enter into database.
    Bascially the reset works fine if I use it before using the submit button in the form. For instance,if on submit there is some error as the values have not passed a validation. There is a error pop up message shown and the values are retained in the field and Now if I use reset , all the values of the field do not go back to null.
    I am new with form validation. I checked online and it said that reset will not clear if we have used submit and we need to use javascript to do it.
    So I made reset into a button which onclick event calls the reset() function and clears the form but I am sure that the code is not right as it is not working, I tired putting a alert message in my function to reassue that the function is being called but I think it is not.
    Posting my code
    <INPUT id=reset1 name=reset1 type =button value=Reset onClick="reset()">
    <Script>
    function reset()
    alert ("all values shall be cleared now");
    document.frmUser.name.value = "" ;
    document.frmUser.uservalue  = "" ;
    document.frmUser.contactNumbervalue  = "";
    document.frmUser.emailvalue  = "" ;
    </Script>
    I am not sure if its the best way to do it.
    I want the whole form to refresh/ reload every time reset is clicked and all the fields to have no values.
    Thanks for the help in advance.
    Sumant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi .
    I got break on this issue by following the code snippet
    <script >
    function clearForm() {
    document.getElementsByName('foo')[0].value = '';
    document.getElementsByName('bar')[0].value = '';
    document.getElementsByName('baz')[0].value = '';
    </script>
    <html:button value="Clear" onklick="clearForm() />
    thanks,
    Sumant K

  • SJSWS 7.0U1 - Resets Permissions on Deploy Changes

    I have several web server configurations (single instance of each config, no additional virtual servers), and since each config belongs to a different client/user:group, the permissons on the config directory are set to reflect these ownerships, mostly user-only-accessible.
    For admin purposes, I like to modify (loosen) these permissions to make them group-accessible (to the admin group). Whether or not this is a particularly good idea could be a discussion for another day :-)
    My problem is that each time I make changes to a configuration, the act of deploying the changes to the web server instance (using the GUI/Admin Console) resets the ownerships & permissions in the config directory to be user-accessible to the client user:group, i.e. as it was at creation.
    This means I then have to change ownership/permissions to get back to (my idea of) a correct configuration.
    Is there any way to either:
    1. Prevent SJSWS from doing this in the first place, or
    2. Trigger my script to reset permissions after deployment
    I'm probably onto a loser here, but I figured I ask in case anyone else has tripped over this and discovered a solution!
    Thanks for any input.

    I have several web server configurations (single instance of each config, no additional virtual servers), and since each config belongs to a different client/user:group, the permissons on the config directory are set to reflect these ownerships, mostly user-only-accessible.
    For admin purposes, I like to modify (loosen) these permissions to make them group-accessible (to the admin group). Whether or not this is a particularly good idea could be a discussion for another day :-)
    My problem is that each time I make changes to a configuration, the act of deploying the changes to the web server instance (using the GUI/Admin Console) resets the ownerships & permissions in the config directory to be user-accessible to the client user:group, i.e. as it was at creation.
    This means I then have to change ownership/permissions to get back to (my idea of) a correct configuration.
    Is there any way to either:
    1. Prevent SJSWS from doing this in the first place, or
    2. Trigger my script to reset permissions after deployment
    I'm probably onto a loser here, but I figured I ask in case anyone else has tripped over this and discovered a solution!
    Thanks for any input.

  • How to: script or shortcuts

    Hi,
    I am 3 weeks into using the mac and loved it.
    I have set my imac to NEVER sleep because I am always constantly doing FCP video captures. When I am done with it, I have to manually go back to reset my sleep and energy preferences.
    I am just wandering to see if there is/are any shortcuts or scripts that I can create to reset the preferences or do any type of scripting within mac os. This way, I can just click on the script and it will do the job for me.
    Any help appreciated.

    The following script should reset your Energy Saver preferences.
    *tell application "System Preferences"*
    *reveal pane id "com.apple.preference.energysaver"*
    *tell application "System Events" to tell process "System Preferences"*
    *click button 1 of tab group 1 of window 1*
    *end tell*
    *end tell*

  • Reset song start and stop times

    Resetting start and stop times for all songs.
    Hi. I recently trialled a DJ BPM matching software product and unknown to me, it scanned all my songs and in the majority of cases, put new start and stop times (in seconds) so now when I play my songs in iTunes, they either start to play early and/or stop playing before they are complete.
    I can go and reset these parameters manually but I have 5000 songs so wondered if there was a utility or a file I could edit that would do this for me as its really annoying that the DJ software didnt reset these when I uninstalled it at the end of the trial period.
    Thanks
    Jason

    You might be able to use this script to reset the start/stop times to zero.  Try with a small selection and see if it works for you.
    http://dougscripts.com/itunes/scripts/ss.php?sp=batchtrimtime

  • Folder and Sub-Folder Batch load Script

    What I'm looking for I'm not ever sure is possible, but what I need is a script that will search for predefined sub-folder names within a specific "root" folder and run a script I have to load those images into a Photoshop document found within the root folder.  When loading these images, it will also need to place the images into a specific group within the Photoshop document, depending on the sub-folder that contained them.  So images in the sub-folder "A" need to be loaded into the group "A" in the Photoshop document, images in sub-folder "B" into group "B" and so-on.  The number and name of images within the sub-folders are, however, random; so this would also need to be accounted for.  Additionally, if possible, I would like the script to ask the user to locate this root folder each time before proceeding; otherwise, if not possible, a static folder location can also be used.  Thanks for any help!
    dgolberg

    Profile-mismatches as in: When the container document and the image to be placed are of different Color Spaces (different ICC-profiles).
    Could you give this a try (on a copy of your files naturally); it places as Smart Objects (depending on your Photoshop > Preferences > General settings), but you could always rasterize after the import or chenge the preference in the Scripts and reset it at the end:
    // place png-files from a folder and its contained folders with groups to represent those in jpg-files;
    // 2011, use it at your own risk;
    #target photoshop
    // select folder;
    var theFolder = Folder.selectDialog ("select folder");
    if (theFolder) {
    // get the jpgs;
    var theJpgs = getJpgFiles(theFolder);
    // iterate through the jpg files;
    for (var m = 0; m < theJpgs.length; m++) {
    var theDoc = app.open(new File(theJpgs[m]));
    // thanks to xbytor;
    var theName = theDoc.name.match(/(.*)\.[^\.]+$/)[1];
    // place the png-files in groups coresponding to the folders;
    placeFolderFiles(theFolder, theDoc, theName)
    ////// ceck for jpgs //////
    function checkJpg (theFile) {
        if (theFile.name.match(/\.(jpg)$/i)) {
            return true
    ////// ceck for pngs //////
    function checkPng (theFile) {
        if (theFile.name.match(/\.(png)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return app.activeDocument.activeLayer;
    ////// place images in folder and contained folders //////
    function placeFolderFiles (theFolder, theContainer, theName) {
              var theContent = theFolder.getFiles();
              for (var n = theContent.length - 1; n >= 0; n--) {
                        var theObject = theContent[n];
                        if (theObject.constructor.name == "Folder") {
                                  var aFolder = theContainer.layerSets.add();
                                  aFolder.name = Folder(theContent[n]).name;
                                  placeFolderFiles(theObject, aFolder, theName)
                        if (checkPng(theObject) == true && theObject.name.match(theName)) {
                                  var theLayer = placeScaleFile(theObject, 0, 0, 100);
                                  theLayer.name = File(theObject).name;
                                  theLayer.move(theContainer, ElementPlacement.PLACEATBEGINNING)
    ////// place images in folder and contained folders //////
    function getJpgFiles (theFolder) {
              if (!theArray) {var theArray = new Array};
              var theContent = theFolder.getFiles();
              for (var n = theContent.length - 1; n >= 0; n--) {
                        var theObject = theContent[n];
                        if (theObject.constructor.name == "Folder") {
                                  theArray = theArray.concat(getJpgFiles(theObject))
                        if (checkJpg(theObject) == true) {
                                  theArray.push(theObject)
              return theArray

Maybe you are looking for