serching for a script to set the file name of the linked files

Hello

I m looking for a script that can place the filname of a linked picture. As in the example:

Beispiel.png

I need to create a compilation of a few photos in a single file. To distinguish the pictures I want to put the name of the file next to the image. The name of the information file that is to be placed, I have woult like to get to the link information.

Thanks for your help!

MS

Hello my dear, try this:

var myDoc = app.activeDocument;

var itemPlaced = myDoc.placedItems;

for ( i = 0; i < itemPlaced.length; i++ ) {

    var sliceString = String(itemPlaced[i].file);
    var sliceThisString = sliceString.slice(sliceString.lastIndexOf('/') + 1, sliceString.length);

    var Texto = myDoc.textFrames.add();
    Texto.textRange.characterAttributes.textFont = app.textFonts['ArialMT'];
    Texto.textRange.characterAttributes.size = 7.57;
    Texto.textRange.characterAttributes.alignment = StyleRunAlignmentType.center;
    Texto.contents = sliceThisString;
    Texto.rotate (90);
    Texto.top = ((itemPlaced[i].top - itemPlaced[i].height) + Texto.height);
    Texto.left = ((itemPlaced[i].left + itemPlaced[i].width) + Texto.width);

};

It is loop first "set items" and create it down right. Is this good?

Best regards

-Vinicius

Tags: Illustrator

Similar Questions

  • I click on the links in the email and get a box that says: "this file does not have a program associated with it for performing this action" and the link cannot be opened.

    Original title: problem e mail

    I click on the links in the email and get a box that says: "this file does not have a program associated with it for performing this action" and the link cannot be opened.

    Suggestions;

    1. make sure that your e-mail program is your default program.

    2. make sure that your Internet Explorer, or your main browser has all its faults.

    You can do both of the above by following these steps...

    Start button > right column, click default programs > click Set Your Default programs...

    1. click on your e-mail program > it doesn't say "this program has all its defaults"?
    If not, click on choose by default for this program > check all boxes below the list > click on save when finished.

    2 do the same as above for your Internet Explorer, or your main browser.

  • Script to renumber the links in random order

    I have Chapter 1 page with 50 small photos in a very Orthodox and symmetrical grid should I repeat in a different random order for other chapters.

    Links have a logical syntax numbered like:

    pict1. TIF

    PICT2. TIF

    etc.

    For Chapter 2, the idea is to repeat the first but in a random order. Same photos, same layout, different order.

    Perhaps a script could rename the links?

    Thus, once the folder is duplicated, I'll have a second folder:

    Photo 1. TIF is now, for example, pict45.tif

    Picture2.tif.is now, for example, pict13.tif

    etc.

    IF I recreate a link to a copy of Chapter 1 of this second issue perhaps the idea could be resolved.

    Jarek, salvation.

    It works when it's only ONE image per page.

    But, with lots of photos on the page, as in the example, the script is dead.

    (no error at all)

    I have six pages with the same grid of images repeated in a file.

    The idea is that, at 2, 3, etc., the script changes the order randomly have different positions.

    I have tried various combinations but were useless.

    Thank you.

    PD. The screenshots show the script works with simple images.

  • Script to set the CPU and memory for VMS

    Hi all

    We have an environment with 100's of virtual machines. We have classified these VMs, and each category will have specific vMem and vCPU. Excel / csv spreadsheet has the list of virtual machines, as well as the values of vCPU and vMem. I'm looking for a script that can set the values of vCPU and vMem for virtual machines according to the directives of the excel sheet. If anyone can help with this?

    Thank you very much

    Try this.  I took the function of hotadd from here:

    http://ICT-freak.nl/2009/10/05/PowerCLI-EnableDisable-the-VM-hot-add-features/

    I tested against 1 VM and it works well.  It will make a loop and power all VM power off in parallel, then it will change all.  Then turn on all at the same time.  If you do not parallel you can change it.

    I would like to test in your lab or against 1-2 not prod the first VM.

    Same CSV colum

    VMNAME, MEM, CPU

    Function Enable-MemHotAdd($vm){    $vmview = Get-vm $vm | Get-View     $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    
        $extra = New-Object VMware.Vim.optionvalue    $extra.Key="mem.hotadd"    $extra.Value="true"    $vmConfigSpec.extraconfig += $extra
    
        $vmview.ReconfigVM($vmConfigSpec)}
    
    Function Enable-vCpuHotAdd($vm){    $vmview = Get-vm $vm | Get-View     $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    
        $extra = New-Object VMware.Vim.optionvalue    $extra.Key="vcpu.hotadd"    $extra.Value="true"    $vmConfigSpec.extraconfig += $extra
    
        $vmview.ReconfigVM($vmConfigSpec)}
    
    $vmlist = Import-CSV C:\csvfile.csv
    
    foreach ($item in $vmlist) {    $vmname = $item.vmname    Stop-VM -VM $vmname -RunAsync     }foreach ($item in $vmlist) {
    
        $vmname = $item.vmname    $cpu = $item.cpu    $mem = [int]$item.mem * 1024    Enable-MemHotAdd $vmname    Enable-vCpuHotAdd $vmname    Set-VM -VM $vmname -NumCpu $cpu -MemoryMB $mem -RunAsync -Confirm:$false
    
    }
    
    foreach ($item in $vmlist) {    $vmname = $item.vmname    Start-VM -VM $vmname -RunAsync     }
    
  • Is there a Script to set the same height for several objects?

    Hello world

    I'm looking for a Script that would apply the same Dimensions height or width (proportions MADE) to several objects at once.

    I will appreciate the help

    Thank you

    Hi Lula Rocha,.

    Try SetAllTheThings.jsx, written by John Wundes.

    Have fun

  • Script to set the static Mac address

    I have an Infrastructure virtual with about 200 vm with several vNIC and automatic Mac address. I need to assign static Mac for all NICs for and want to perform this operation with a powershell script and a csv input file. I have the entry csv file that looks like this: Vm, portgroup Mac Vm1 00:11:22:33 Vm1, pg1, pg2, 00:11:22:44 Vm2, pg1, 00:11:44:44 (I know the Mac above are not valid) can anyone help with the powershell code to automate the static configuration of mac?  Thanks in advance

    Hello, ITS.

    You should be able to use the following to achieve:

    ## import the info from the CSV$colNICInfo = Import-Csv c:\vmNICInfo.csv$colNICInfo | %{    $oSingleNICInfo = $_    ## get the VM, get its NetworkAdapters and for the one whose NetworkName matches that from the CSV, set its MAC address    Get-VM $oSingleNICInfo.VMName | Get-NetworkAdapter | ?{$_.NetworkName -eq $oSingleNICInfo.NetwkName} | Set-NetworkAdapter -MacAddress $oSingleNICInfo.MACAddr -Confirm:$false -WhatIf} ## end foreach-object
    

    A few things to note:

    • I left the '-WhatIf "parameter on the Set-NetworkAdapter portion, so that you can run this first (perhaps with a small sample of game in the CSV file) to check that things look like they will work.  Remove this parameter to set the MAC addresses
    • The code provides that the CSV of this format:
      MACAddr VMName, NetwkName,
      someVM, VLAN128, 00:50:56:00:00:0F
    • The cmdlet Set-NetworkAdapter requires the new MAC address in the range 00:50:56:00:00:00 - 00:50:56:3F:FF:FF.  It's not the range likely to use, VMware only a subset.  Seems to be a limitation of the cmdlet (probably intentional).

    Message edited by mattboren: added a note about removing "-WhatIf" to actually set the MAC addresses of the network adapters

  • How can I write a script to set the maximum pixel dimensions?

    I need lots of JPGs and limit the maximum size of 500 px. This must apply to the largest side of the image, either in height or width. The other side should auto size proportionally. I currently have to make these changes to size manually. I have not found any scripting language or function which will allow me to set the size of larger pixel to 500 px, no matter what size is the most important.

    Example:

    1. If the image is 1000 w x 750 px: px, I want the script to resize the image proportionally to the largest side, change the width to 500 px

    2. If the image is 750 px x 1000 px h w, I want the script to change the height to 500 px and proportions are consistent for the width

    All ideas are welcome grately.

    Thank you

    Linda

    Create an action that use file - automate - Fit Image.

    I think that there may always be a bug that this should fix...

    Mage http://www.PS-scripts.com/BB/viewtopic.php?f=10&t=3370&p=15152&Hilit=Don%27t+Enlarge+fit+i & sid = ea73e8349aaf965015a4a351340e865d #p15152

  • How can I use a script to set the variables?

    I have a script to set a few variables and I need to run the script multiple times throughout the form, for different users at different times.  How can I configure the script as an object in the Variables and call it when I need to run it?  Appreciate all help.  I use SS3.

    var emailSubject = "";
    var cleanDate = Page1.EventDetails.Block2.SpeakingDate.rawValue.replace(/[\/]/g, "-");
    var eventName = Page1.EventDetails.Block1.EventName.rawValue;
    var eventCity = Page1.EventDetails.USaddress.CityEvent.rawValue;
    var eventState = Page1.EventDetails.USaddress.StateEvent.rawValue;
    emailSubject = cleanDate + " - " + eventName + " - " + eventCity + " - " + eventState;
    

    To create a function to be able to reuse the code easily right click in your hierarchy (for example, on your "form1"), click "insert a Script object.

    A new script object will be created, just rename it to something appropriate and then create a function both inside and

    function myFunction(var1,var2,var3){
    ' just an example '
    page1.textfield1.rawValue = var1 + var2 + var3
    }
    

    (I didn't fully understand the significance of the date and the event and the city, and exactly what your function is supposed to do, but it's how you declare a function).

    To call this function you simply reference as form1.scriptobjectname.myFunction(123,"asdf",variablename)

    (just one example of the possible arguments).

    I hope that's not too hard to follow,

    Best regards, Mattias

  • Looking for a Script to check the current status of the VM tools based on resource pool (customer name)

    Hi all and

    LucD The champion!

    I'm looking for a power-cli script to verify the State of VM-tools of all the virtual machines in the cluster multi environment. Could you please help me on this. It would be really appreciated.

    Thank you. in advance.

    Concerning

    Nauman

    Try like this

    $report = @)

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    foreach ($vm in (Get-VM-location the $rp)) {}

    $report += get-disk hard - VM $vm |

    Select @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}},

    @{N = "VM"; E = {$vm. Name}},

    @{N = 'Tools status'; E = {$vm. ExtensionData.Guest.ToolsStatus}},

    @{N = 'HD'; E={$_. Name}},

    @{N = "Datastore"; E={($_. Filename.Split(']') [0]). TrimStart('[')}},

    @{N = 'Filename'; E={($_. Filename.Split('_') [1]). "Split('/') [0]}},"

    @{N = 'Path VMDK'; E={$_. File name}}.

    @{N = "Format"; E={$_. StorageFormat}},

    @{N = ' Type'; E={$_. DiskType}},

    @{N = "CapacityGB"; E={$_. CapacityGB}}

    }

    }

    }

    $report | Export Csv C:\temp\report.csv - NoTypeInformation - UseCulture

  • script to set the path

    Hi friends,

    I need help if someone wrote the same type of script, please help me. My requirement is:

    I have a folder structure in the unix box "/ 11 g/admin/soa_domain115/Server/soa_domain/servers/WLS_SOA1/logs / '. What I want when I log on to unix machine with my authentication of the user credentials and do sudo su - soaadmin and write to tail f WLS_SOA1.log, it should show me the output of the file WLS_SOA1.log.

    WLS_SOA1.log file exceeds under the folder location that is ' / 11 g/admin/soa_domain115/Server/soa_domain/servers/WLS_SOA1/logs / '.

    Thanks in advance.

    He showed me out but when I "tail-f $WLS_SOA2" he invited this error message
    tail: cannot open ' /11g/admin/soadomain/node1/mserver/soadomain/servers/WLS_SOA/logs/WLS_SOA2.log

    It seems that you have made a typo, for example missing WLS_SOA2 in the path to the file.

    For approach 2 Yes, I did with mytail option

    Please present the command you type, including the error message.

    How can I cancel it, then that when I login as sudo my way get to the location of a particular path.

    Just change the file (vi ~/.bash_profile) and remove the CD command you added. Don't know what else I can tell you here.

  • Table row with loop for each group to set the variable.

    HI: There is probably a simple answer for this, but I don't the have not found...

    I have a single row table to move through a group to set a variable containing a sum running. I'm not display the amount in the table but when I saw the report, I see that the table is expanding (add lines) for each loop.

    The only line table has 3 columns.

    1st column
    <? for-each: AC_GROUP? >

    2nd column
    <? xdoxslt:set_variable ($_XDOCTX, 'xAmtVar', xdoxslt:get_variable($_XDOCTX,'xAmtVar') + CURRENT_AMOUNT)? >

    3rd column
    <? end foreach? >

    Can I use <? for each group? > or something else. My requirement is to set the value of the variable with the total running, but because the loop is adding lines for each value he travels (though not displayed), it's also affecting other areas of the presentation of the page.

    Hope it makes sense. Thanks in advance.

    You can do it many ways.

    No need to loop
    You can create a variable and specify the amount of the sum directly to that.

    
    

    or

    loop through, then add as you do.

    
    

    give any space or enter characters in a word between them, just put it in a single form field will be

    But as I said, I'd definitely go with the first option.

  • [Req] script to update the links in Indesign using spotlight

    Hello

    I have a challenge, can someone help me please?

    I'm a graphic designer from Holland and I work with a lot of Indesign documents

    which links are missing because they are displaced, so that they are some share on our server.

    I have several scripts to connect the missing links, but they are slow,

    because they each directory and in each subdirectory. It takes some time.

    The apple search engine, Spot, is much faster.

    So I think that I have this great idea, I thought about the following:

    I select a missing link in the linkpanel in Indesign.

    Then I run the script.

    The path of the missing link is copied and ready to just the name of the file

    The name of the file is then copied to the Clipboard.

    The script then opens the dialog window to repeat the missing link.

    It the name of the image is pasted into the spotlight search engine.

    Here, the script stops.

    Click the correct file (if there is more choises) and recreate it a link is done.

    I think that this way of restoring links can be much faster.

    And you can also work with predefined smart windows (to limit results), for example:

    -a witch only shows jpg

    -a witch only shows tiff

    -a witch only shows pdf

    I know a very small little scripting, but this one I can't understand yet.

    Can someone give me help please?

    Best regards, Eric

    PS. I'm still working in CS4

    Although you have a solution and sorry for quitting yout ID should have tested more then once, it was a pretty old script and I just copy and paste...

    just rewritten my old script a little to run on ID CS OSX 10.7.4 5.5

    Should pass on missing links in the Active Document, use mdfind to search for files with simular names as name of missing link in the given directory, reveals possibly the file in the finder and shows / selects currMissingLink in ID-file. If 'ok' rebuild the missing link (without leaving ID ;-) I hope).

    global myFolder
    
    set tid to AppleScript's text item delimiters
    
    tell application "Adobe InDesign CS5.5"
        set currDoc to active document
        set theMissingLinks to every link of currDoc whose status is link missing
        if theMissingLinks is not {} then set myFolder to choose folder with prompt "Where to search for the missing links?" --select a mounted volume, folder ...
    
        repeat with missingLink from 1 to count of theMissingLinks
            set currMissingLink to item missingLink of theMissingLinks
            set currFileName to name of currMissingLink
            set theResultList to my mdFind(currFileName)
    
            if theResultList is not {} then
                repeat with i from 1 to count of theResultList
                    set theItem to (item i of theResultList)
    
                    set currDialog to display dialog theItem with title "Relink this file?" buttons {"OK", "Cancel", "Show in Finder first"}
                    if button returned of currDialog is "OK" then
                        try
                            relink currMissingLink to POSIX file theItem
                        on error e
                            display dialog e
                        end try
                    else if button returned of currDialog is "Show in Finder first" then
    show  currMissingLink --select the missing link in ID
                        my revealInFinder(theItem) --show the found file in finder
                        activate
                        set currDialog to display dialog theItem with title "Please switch to Finder to see the file. Relink the file shown in Finderwindow?" buttons {"OK", "Cancel", "Continue searching"}
                        if button returned of currDialog is "OK" then
                            try
                                relink currMissingLink to POSIX file theItem
                            on error e
                                display dialog e
                            end try
                        end if
                    end if
                end repeat
            end if
        end repeat
    
    end tell
    
    on mdFind(currFileName)
        set AppleScript's text item delimiters to return
        set PathToAllFiles to every text item of (do shell script "mdfind -onlyin '" & quoted form of POSIX path of myFolder & "'" & space & " -name '" & currFileName & "'")
    
        set PathToAllFiles to my cleanList(currFileName, PathToAllFiles)
    end mdFind
    
    set AppleScript's text item delimiters to tid
    
    on cleanList(fileName, listOfFilePaths)
        set myCleanList to {}
        set AppleScript's text item delimiters to "/"
        repeat with p from 1 to count of listOfFilePaths
            set aName to (text item -1 of (item p of listOfFilePaths))
            if aName is equal to fileName then set end of myCleanList to (item p of listOfFilePaths)
        end repeat
        return myCleanList
    end cleanList
    
    on revealInFinder(somePosixPath)
        tell application "Finder"
            set myAlias to (POSIX file somePosixPath) as alias
            activate
            reveal myAlias
        end tell
    end revealInFinder
    

    Hope it will work

    Hans-Gerd Classen

  • Girls need help with a script to repeat the link to another folder in indesign

    I REALLY hope you smart people can help me.

    We had servers which means that all of our Indesign documents now have a broken link. To manually "re-edit the link to the file" causes Indesign down :-(. And it takes forever I am hoping to find a script that can connect all the links in the doc to a new file structure.

    The name of the link (name of file) and the file structure remains the same; Just point to another server. The structure contains subfolders so the best way would be that the script can see subfolders as well, but otherwise I would gladly use a script that points of 6 subfolders at a time.

    Problem - I KNOW NOT ALL SCRIPTS and I'm a graphic designer so I can't create scripts :-(. I have already had success Googling a script to unlink everything in the document, but I don't know how to run the script. DO NOT to create them.

    ANY help in this forum? I have 6 designers waiting for me to fix this.

    Is there a script where I could just change the path and then he could repeat?

    We have iMac OSX Yosemite 10.10.4

    PLEASE HELP... :-)

    / Dina

    Try this... it is created by Vamitul

    main() {} function

    var doc = app.activeDocument;

    myLinks var = doc.links.everyItem () .getElements ();

    var linkObj = {};

    Create the initial object

    / * {linkObject

    [path] {missingNr,

    arrayOfMissingLinks}

    } */

    for (var i = 0; i)< mylinks.length;="" i++)="">

    If (myLinks [i] .status == LinkStatus.LINK_MISSING) {}

    var myPath = File(myLinks[i].filePath).path.toString ();

    If (linkObj [myPath] == undefined) {}

    linkObj [myPath] = {}

    missingNr: 1.

    missingLinks: [myLinks [i]],.

    newPath: "

    }

    } else {}

    linkObj [myPath] .missingNr ++;

    linkObj [myPath].missingLinks.push (myLinks [i] .getElements () [0]);

    }

    }

    }

    $.writeln (linkObj.toSource ());

    var myDialog = new window ("dialog", "link Chaser:', undefined");

    Panel1 = myDialog.add var ('panel', undefined, "double-click to select the new path '");

    Panel1. Align = ["fill",""];

    myList var = panel1.add ("listBox", undefined, "", {})

    columnWidths: [160, 160, 130],

    numberOfColumns: 3,.

    showHeaders: true,

    columnTitles: ['old road', 'New Path', 'Nr. missing links']

    });

    myList.size = [450, 200];

    myList.align = ["fill",""];

    for {(var missingPath in linkObj)

    with (myList.add ("item", missingPath)) {}

    Subitems [0] .text is linkObj [missingPath] .newPath;.

    Paragraphs [1] .text is linkObj [missingPath] .missingNr;.

    }

    }

    myList.onDoubleClick = function() {}

    var myNewPath = (new folder (app.activeDocument.filePath) .selectDlg ("Select New Folder") |. toString() ' ");

    myList.selection.subItems [0] .text = myNewPath;

    linkObj [myList.selection.text] .newPath = myNewPath;

    }

    myDialog.add ('button', {undefined, "Ok",

    name: 'ok '.

    });

    myDialog.add ("button", undefined, "Cancel", {})

    name: "Cancel".

    });

    If (myDialog.show () == 1) {}

    for (var i in linkObj) {}

    If (linkObj [i] .newPath! = ") {}

    var fixedNr = 0;

    Var links = linkObj [i] .missingLinks

    for (var j = 0; j)< links.length;="" j++)="">

    var queue = newFile (linkObj [i] .newPath + "/" + links [j] .name);

    If {(newFile.exists)

    fixedNr ++;

    Links [j] .relink (NewFile);

    }

    }

    Alert ("in the folder: \n" + linkObj [i] .newPath + '\n' +)

    'Fixed' fixedNr ' links of ' + linkObj [i] .missingNr + '\n ' +.

    "Please check");

    }

    }

    };

    }

    app.doScript ('main()', undefined, undefined, UndoModes.entireScript, "Chaser link");

  • How can I set the links to open in a new window?

    I use the links tool in Acrobat 5.05 to create links in my pdf to other sites, not documents. When the pdf file is displayed online, I need these links to open in a new window. Now, they open in the same window, which submits the Viewer to using the back button to return to the original pdf and waiting so he could fully recharge. It is a sizeable pdf file, which makes a lot of your time. I tried unchecking the option on 'Cross Document links in same window', but tests indicated that there was no difference.

    If you need more information to clarify my question, please just ask. Suggestions regarding the solve this will be appreciated.

    My apologies if a similar question has already been asked to answer. I have not found the reference to it in my search.

    Thank you.

    You can use JavaScript to do this. For example:

    app.launchURL ("http://www.adobe.com", true);

    More info is Acrobat JavaScript reference. Note that this method is new in Acrobat 7. You can still use Acrobat 5 to create the JavaScript code, but it won't work for less than 7 versions, or most of the users of non Adobe PDF viewers. If you follow this path, you should add code that checks the version of Acrobat (reader) and just run the code above, if 7 or higher.

  • I need an add-on for close tabs automatically when the link is redirected in mozilla firefox

    Hello...

    respected sir
    i need an add on or any software to close tabs automatically...
    when the link is redirected in Mozilla Firefox
    

    pls help me out here...
    If it's them I'm going to pay for it
    I need immediately...
    Thank you

    How is this different to open this link in the same tab?

Maybe you are looking for