Obscure file name script advice

I have a CD full of images created on OS/X with file names like
R 519 (S 64).jpg
I have a list of these file names and the names to which I need to change.
In a sh srcipt I tried all of these variations
mv 'R 519 (S 64).jpg' x
mv "R 519 (S 64).jpg" x
mv "R\ 519\ \(S 64\).jpg" x
The files show normally in Finder but there is thousands of them and I would like to do it in batch.
Could you please suggest a workable solution?

This thread is very difficult to follow (I'm not a native English speaker).
First of all, is the problem "Solved"? It seems your "problem" has changed a few times. Exactly what is you problem?
I have a CD full of ....
You can't rename files on CD (it's read only). I assume you have copied them to your hard drive.
mv 'R 519 (S 64).jpg' x
mv "R 519 (S 64).jpg" x
mv "R 519 (S 64).jpg" x
None of them works.
Very strange. As Mark writes, the first one (single quote) should work. The second one (double quote) should also work. What kind of error do you get?
the issue is renaming files whose names are in a text source file to arbitrary names in the same source file, like in:
oldname1 newnameI
som other name yet another new name
Is this your (current) problem?
If both oldname and newname contain spaces, then it is obviously impossible to figure out where oldname ends and newname starts. If it is guaranteed that *the newname does not contain any space*, then your task can be easily done by a simple shell script, for example
#!/bin/sh
while read -a line
do
n=${#line[*]} # number of words on this line
oldname="${line[*]: 0: $n - 1}"
newname="${line[$n - 1]}"
echo 'rename "'$oldname'" to "'$newname'"'
# mv "$oldname" "$newname"
done < thelist
Here "thelist" is the name of the file containing the list of "oldname newname" pair (a pair in each line). The "mv" command is commented out since it is rather dangerous. If you are satisfied with the output of echo, then uncomment the mv command.
If I correctly understood (or guessed) your problem, then this should solve it. But you write
The problem is in matching the names in left column with the names in OS/X file system
What do you mean by "matching the names"? You also write
I solved now as a bypass by obtaining the "real" file name through find, ...
What do you mean by "real file name"? You mean "R 519 (S 64).jpg" is not a real name? I feel I'm still missing your "real" problem.

Similar Messages

  • Re Trim file name scripts in SL

    Below is a frozen, unanswered conversation regarding the missing finder scripts in SL. Luckily, I make a complete backup before converting, so I still have all the old Leopard scripts. Norwichfan, I feel your pain, and I thought that archiving your thread without an adequate answer was wrong.
    Here's your answer. you can just get a copy of the old finder scripts, put them in /Library/Scripts and they'll show up in your script menu as before. I have zipped up a copy of them and posted them here:
    http://tedward.org/finder_scripts.zip
    norwichfan88
    Posts: 12
    From: Australia
    Registered: Mar 25, 2010
    Trim file name scripts in SL
    Posted: Mar 26, 2010 6:26 PM
    I have recently upgraded to SL and have found that the trim/add to file name applescripts from leopard are missing from my scripts menu.
    Is there a place I can find these for SL?
    MBP mid-2009 Mac OS X (10.6.2)
    Pierre L.
    Posts: 824
    From: Québec
    Registered: Jan 26, 2009
    Re: Trim file name scripts in SL
    Posted: Mar 26, 2010 6:49 PM in response to: norwichfan88
    Solved
    Maybe something similar in this web page?
    15-inch MacBook Pro 2.53 GHz Mac OS X (10.6.2) AirPort Extreme
    norwichfan88
    Posts: 12
    From: Australia
    Registered: Mar 25, 2010
    Re: Trim file name scripts in SL
    Posted: Apr 10, 2010 12:03 AM in response to: Pierre L.
    Thanks for the web page, had a look but not having done any work with applescript or other programming language was a bit over my head.
    I decided to make a temporary solution with and automator action.
    MBP mid-2009 Mac OS X (10.6.2)

    Thanks for the web page, had a look but not having done any work with applescript or other programming language was a bit over my head.
    I decided to make a temporary solution with and automator action.

  • How to alter 'add to file names' script?

    I'm working on some stuff that I need to get done today, and it dawned on me that I could save a lot of time if I had a certain script perform a simple task for me. Unfortunately I haven't been able to get one to work right. I just want to be able to add the same thing onto the end of a file name... For instance, 01.jpg would become 01x.jpg, 02.jpg becomes 02x.jpg and so on. The basic 'Add to File Names' script will almost work, but it adds to the front of the name, not the back. Does anyone know how I could alter the lines in that script to get it to do what I want?
    Thanks for any help,
    Dave

    01. Under 'Alternative 01:', the line ...
    No error checking for folders is included. Such is an exercise for the student.
    ... should have been ...
    --No error checking for folders is included. Such is an exercise for the student.
    02. The error message ...
    "System Events got an Error: NSCannotCreateScriptCommandError".
    Hmmm, those replying are using MacOS X 10.4.x, and you are using MacOS X 10.2.x. Others, with Macs running MacOS X 10.2.x and using AppleScript code from MacOS X 10.3.x and later, do at times experience 'NSCannotCreateScriptCommandError' error messages.
    In the code below, 'System Events' was replaced with 'Finder'. Some additional editing was performed, where required.
    Alternative 01:
    property tAddition : "x" -- The charcter or string to append to the files' name.
    tell application "Finder"
    set tSelection to selection
    --No error checking for folders is included. Such is an exercise for the student.
    repeat with i in tSelection -- Cycle through the provided files.
    set {displayed_name, name_Extension} to {displayed name of (i as alias), name extension of (i as alias)}
    if ((displayed_name ends with name_Extension) and ((count name_Extension) > 0)) then
    -- Handle file names which include a name extension.
    set (name of i) to ((get (characters 1 through ((count displayed_name) - (count name_Extension) - 1) of displayed_name) as string) & tAddition & "." & name_Extension)
    else
    set (name of i) to (displayed_name & tAddition) -- Handle file names without a name extension.
    end if
    end repeat
    end tell
    Save the AppleScript code as a script.
    Move file (or a copy or alias of the file) to the '~/Library/Scripts/' folder.
    Select files to be processed, in 'Finder'.
    Select the script, via the 'Script menu'.
    Alternative 02:
    property tAddition : "x" -- The charcter or string to append to the files' name.
    on run {} -- User double-click on the applet.
    display dialog "Drag file(s) onto applet for processing."
    end run
    on open selected_Items -- User dragged items onto applet.
    my handleitems(selectedItems) -- Processed items dragged onto applet.
    end open
    on handleitems(localItems)
    -- No error checking for folders is included. Such is an exercise for the student.
    tell application "Finder"
    repeat with i in local_Items -- Cycle through the provided files.
    set {displayed_name, name_Extension} to {displayed name of i, name extension of i}
    if ((displayed_name ends with name_Extension) and ((count name_Extension) > 0)) then
    -- Handle file names which include a name extension.
    set (name of i) to ((get (characters 1 through ((count displayed_name) - (count name_Extension) - 1) of displayed_name) as string) & tAddition & "." & name_Extension)
    else
    set (name of i) to (displayed_name & tAddition) -- Handle file names without a name extension.
    end if
    end repeat
    end tell
    end handle_items
    Save the AppleScript code as an applet (application).
    Drag files to be processed, onto the applet, in 'Finder'.

  • Add file name script not working in CS3

    I have this wonderful script (written by Brian Price) back in 2004 for PS7 that adds the file name to an image ( I use it for adding file names to small images to be used in a slideshow). It works great ion Photoshop CS, but when I try to use it as part of a batch action in CS3 it stalls on line 9. OIt works fine when run on just one image in CS3 . . . it just stalls when run as part of a batch action!
    Any help GREATLY appreciated!
    Many Thanks,
    Peter Thompson
    [email protected]
    www.photohawaii.com
    Here's the script:
    // this script is a variation of the script addTimeStamp.js that is installed with PS7
    //Copyright 2002-2003. Adobe Systems, Incorporated. All rights reserved.
    //All amendments Copyright Brian Price 2004 ([email protected])
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PERCENT;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = "";
    // Set font size in Points
    myTextRef.size = 30;
    //Set font - use GetFontName.js to get exact name
    myTextRef.font = "ComicSansMS";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 255;
    newColor.rgb.green = 255;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 5, 94);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    I have this wonderful script (written by Brian Price) back in 2004 for PS7 that adds the file name to an image ( I use it for adding file names to small images to be used in a slideshow). It works great ion Photoshop CS, but when I try to use it as part of a batch action in CS3 it stalls on line 9. OIt works fine when run on just one image in CS3 . . . it just stalls when run as part of a batch action!
    Any help GREATLY appreciated!
    Many Thanks,
    Peter Thompson
    [email protected]
    www.photohawaii.com
    Here's the script:
    // this script is a variation of the script addTimeStamp.js that is installed with PS7
    //Copyright 2002-2003. Adobe Systems, Incorporated. All rights reserved.
    //All amendments Copyright Brian Price 2004 ([email protected])
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PERCENT;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = "";
    // Set font size in Points
    myTextRef.size = 30;
    //Set font - use GetFontName.js to get exact name
    myTextRef.font = "ComicSansMS";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 255;
    newColor.rgb.green = 255;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 5, 94);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

  • Add file name script

    I have a script for adding the file name as a text layer in PS. This script called "AddFileName02.js" worked by placing the file in the scripts folder on the hard drive. This script worked for PS CS2 (and I think PS CS3). This script could then be accessed by <file><automate><scripts>
    Now that I have PS CS5 I have tried to place this script into the same place in PS CS5, but it does not appear. (I restarted PS) As I see it there could be two possible problems.
    1 The script has a .js extension and all other scripts in PS CS5 have a .jsx extention. So a newer version may be needed.
    2 I have placed the script in the wrong folder.
    Can anyone help?

    Just rename ist with the jsx-suffix and place it in the Presets > Scripts-folder.
    If that does not work you could try the Photoshop Scripting Forum, though some of the regulars also do drop by in this Forum.

  • Batch Rename PSD Layers to File Name Script?

    Hello,
    I just recieved several thousand .PSD files for a job containing a single layer (named "Layer 1") on a transparent background. I'm trying to find a way to batch rename the layer in each of these files as the file name, sans the file extension. Is there a script out there that can do this for me? Forgive me, I am not too hip with scripts.
    Windows 7 PC, CS6
    Thank you!

    Save the line below into a plain text file and give it the .jsx extension.
    app.activeDocument.activeLayer.name = decodeURI(app.activeDocument.name).match(/(.*)(\.[^\.]+)/)[1];
    Then create an action that runs that script. Then run File-Automate-Batch using that action.

  • Can I script the changing of creation date, using the file name?

    Normally people are doing this in reverse, but let me paint the picture.
    I pulled 204 video files from an old HDD based JVC camera.  JVC records in .MOD format which iPhoto won't import.  I imported them into iMovie just fine, and iMovie even set the file name to clip-2007-11-04 04;42;29.mov which is great, but it now has a new creation date of whatever date I imported it.  Which then causes problem when I want the videos stored in iPhoto and sorted appropriately by creation date.
    I've used the application "A Better Finder Attributes 5" to individually edit the creation and modify, but I'm sure I don't want to do this 203 more times, as you can't just type in the date and time, you have to type in each part of the date/time, or select it on a calendar.
    I've used the application "Name Changer" to batch convert the file names to the format YYYYMMDDhhmm which would be helpful if I were going to use the terminal command touch -t, but again I don't want to have to type it in 203 more times, plus drag and drop the file into finder to populate the location.
    Now, if I were more handy with automator, or maybe some (any) scripting language this would be easy peasy.  I'd batch rename all the files to the YYYYMMDDhhmm.mov and then have a script that just took the file name, passed that to touch -t along with the file location, and a few seconds later, they would all be done!
    Anybody have any suggestions to how I can do this, and tips to what commands to use or ANY advice?  I'm more than happy to RTFM, but I have no idea which manual to read!
    Thanks

    If your file names are precisely as you have written, this script will do what you want.
    Copy the script into an AppleScript Editor document, select one or more files in a Finder window, return to the AS Editor and press Run.  Note: you will need to provide your password when the script runs.
    Make sure you have a backup of any files you are working on (try using duplicates first, perhaps). The script has no error handling.
    tell application "Finder"
              set FileList to selection
              repeat with theFile in FileList
                        set fileName to name of theFile
                        set filePath to quoted form of (POSIX path of (theFile as alias))
                        set crYear to text 6 thru 9 of fileName
                        set crMonth to text 11 thru 12 of fileName
                        set crDay to text 14 thru 15 of fileName
                        set crHour to text 17 thru 18 of fileName
                        set crMins to text 20 thru 21 of fileName
                        set crDate to crYear & crMonth & crDay & crHour & crMins
                        set shellString to "touch -t " & crDate & " " & filePath
      do shell script shellString with administrator privileges
              end repeat
    end tell

  • Apple script to batch rename files by deleting tags on front and back of the file name

    Hi, I'm trying to rename a couple thousand files from their current format:  "01074_Something Of A Dreamer_Mary-Chapin Carpenter.lrc"
                                                                                                                           "01075_Where Did We Go Right_Lacy J. Dalton.lrc"
                                                                                                                           "01076_Everybody's Reaching Out_Crystal Gayle.lrc"
                                                                                                         To simply:  "Something Of A Dreamer.lrc"
                                                                                                                           "Where Did We Go Right.lrc"
                                                                                                                           "Everybody's Reaching Out.lrc"
    I just want to delete the number tag on the front and the artist name at the end for all of the files.  I imagine a Script to do this wouldn't be too hard to write, something along the lines of read file name after the first '_' character it reads until it reads a second '_' character and rename the file to the string it reads between those two underscores with .lrc at the end.
    Unfortunately I know nothing about Apple Script other than it seems like the thing I would need to automate this process based on my limited google searches.  If someone could help me out with some advice on how to go about making this script or obviously if you simply have and/or can quickly write a script to do this it would be greatly appreciated!

    Here:
    tell application "Finder"
    repeat with this_file in (get files of window 1)
    set the_name to name of this_file
    set temp_name to items ((offset of "_" in the_name) + 1) thru -1 of the_name as string
    set temp_name to (items 1 thru ((offset of "_" in temp_name) - 1) of temp_name as string) & items -4 thru -1 of the_name as string
    set name of this_file to temp_name
    end repeat
    end tell
    (123647)

  • DATAEXPORT - set Dynamic File name in Calc Script

    Hi,
    I have a calc script which exports data from BSO cube to a flat file. Currently I have hard coded file name within the calc script which is
    DATAEXPORT "File" "," "D:/in/CAPXPT_FERC_*FY12*.txt";
    and, for example, I want use the substition varaible to dynamically assign the file name let' say
    DATAEXPORT "File" "," "/u11/oracle/OHDDEVD/in/CAPXPT_FERC *" + &fYear + "*.txt";
    Is there any way to set the export file name dynamically?
    Thanks for your help
    Regards,

    A kind of intriguing thought would be to use the sub var as a way to drive the file name, then grab Robb Salzmann's CDF to dynamically set sub vars on the fly, and then use a RTP to grab that string. I have no idea if this would all tie together, but it would be interesting to try.
    Here's Robb's post: http://codingwithhyperion.blogspot.com/2011/08/create-and-update-substitution.html This is my second in a row post that refers to his CDF -- it is almost like that's my pseudonym except of course I'm too thick to write a CDF.
    Regards,
    Cameron Lackpour
    Edited by: CL on Sep 20, 2011 10:36 AM
    Spelling. Arrgh.

  • Same Sender and Receiver File Name. Pls advice urgent

    Hi All,
    My sender file name is auto generated number so
    it is dynamic in nature.
    ex. "abc1.txt"
         "abc2.txt"
    Now In my Sender File Adapter I cannot give
    File Name hard coded as my sender file name is auto generated number.
    Also I want same file name received at receving end.
    File Sender --   "abc1.txt"
    File Receiver -- "abc1.txt"
    File Sender --   "abc2.txt"
    File Receiver -- "abc2.txt"
    Pls advice.
    Regards

    Hi Rider,
    All your sender files have .txt extension but the name is not constant(dynamic in nature).Than in this case to pick ur file u can use the *.txt as ur sender file name.Than all the files with .txt extension in the source folder specified would be picked.
    Than u can proceed in the same way given in this blog
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Please let me know if u need any information
    Thanks,
    Bhargav
    Note:Award points if found useful

  • A script for adding the current date to file name?

    I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?

    ok, I ended up with this test routine:
    on adding folder items to this_folder after receiving added_items
    tell application "Finder"
    repeat with this in added_items
    my checkifopened(this)
    display dialog (name of this) as text
    end repeat
    end tell
    end adding folder items to
    on checkifopened(this)
    set a to POSIX path of (this as alias)
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    exit repeat
    else
    say "still opened"
    end if
    end repeat
    end checkifopened
    this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
    And after adding a timeout (just in case) to this function the final script looks like this:
    on adding folder items to thefolder after receiving added_items
    tell application "Finder"
    set folderkind to kind of thefolder
    set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
    repeat with myfile in myfiles
    set myfile_datestring to my get_datestring(creation date of myfile)
    set myfilename to name of myfile
    if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
    set filestatus to my checkifopened(myfile, 60)
    if filestatus = false then
    display dialog "timeout on folder action"
    else
    set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
    set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
    set name of myfile to myfilename
    end if
    end if
    end repeat
    end tell
    end adding folder items to
    on get_datestring(mydate)
    return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
    end get_datestring
    on checknamewith_pdfsuffix(n, D, looped)
    --check if filename exists in D
    -- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
    #n = string of the filename
    #D = file reference to the directory to check
    #looped = boolean used for recursive loop...
    tell application "Finder"
    set thefiles to name of every item of (D as alias)
    end tell
    if thefiles contains n then
    if looped = false then
    set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    else
    set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
    set tmpcount to (count of characters of (tmp as text)) + 5
    set tmp to tmp + 1
    set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    end if
    else
    return n
    end if
    end checknamewith_pdfsuffix
    on checkifopened(this, mytimeout)
    ## this file reference
    ## timeout in seconds
    set a to POSIX path of (this as alias)
    set startdate to current date
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    return true
    else if ((current date) - startdate) > mytimeout then
    return false
    else
    ##say "still opened"
    end if
    end repeat
    end checkifopened
    to use this save this script in /Library/Scripts/Folder Action Scripts
    and add this as a folder action to your folder...
    The script processes all files inside that folder each time a new files is added...

  • Save As Script with predefined path and file name

    Hello,
    Livecycle version: 8.2.1.4029.1.523496
    The aim of the script I have is to save the livecycle form to a predefined directory and using the values of a text field in the file name.
    The script is placed in an exit event on a field using javascript as follows:
    this.saveAs("/c/forms/Template/Leave Application "  + Applicants_Name.rawValue".pdf");
    The script does not work.
    Can any one please provide some assistance with correcting my script?
    Any help will be most appreciated.

    This solution is misleading....
    Of course this works only if you plan to load Trusted script on each machine you plan to use that form. In other words you can not rollout form to entire organization with out loading trusted function in each targeted machine.
    Also there are other limitations... like if for some reason user reinstalls Acrobat x or Reader x or upgrade to latest version they need to remember to redeploy the trusted function to the required location.

  • Script to create directory based on current file name and then save the file in that directory

    Hi all,
    I have a need save all my projects in a directory using the name of the main image I am working on.
    Manually these are the steps I used:
    Save As.
    Copy ( press command-c <== the filename is highlighted by default so all I have to do is )
    New Folder ( press the new folder button. Brings up a dialog box)
    Paste ( press command-v. <== Pastes the file name into the "New Folder" dialog box.)
    Save ( press thre save button. Saves the files into the new folder )
    Save As.
    Change format to JPG
    Save
    Change image quality to 12
    I want to assign these actions to a key
    Recording these steps and playing them back does not give me the results I need, snce the original name is hard-coded in the actionlist that was recorded
    What should I be doing instead ?
    Thanks in advance !

    You don’t mention which format the original file is (and figuring that and its current settings out seems too much of a hassle to me) so this would only save the jpgs into the folder (and create one if it does not exist).
    If you want to give it a try, paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4 or /Applications/Utilities/Adobe Utilities-CS5/ExtendScript Toolkit CS5) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.
    After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.
    // saves jpg into folder of file’s name next to file;
    // be advised: this  overwrites existing jpgs of the same name without prompting;
    // thanks to xbytor;
    // 2012, use it at your own risk;
    #target photoshop;
    if (app.documents.length > 0) {
    var thedoc = app.activeDocument;
    // getting the name and location;
    var docName = thedoc.name;
    if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]}
    else {var basename = docName};
    // getting the location, if unsaved save to desktop;
    try {var docPath = thedoc.path}
    catch (e) {var docPath = "~/Desktop"};
    // create folder if it does not exist;
    var folderString = docPath+"/"+basename;
    if (Folder(folderString).exists == false) {new Folder(folderString).create()};
    // jpg options;
    var jpegOptions = new JPEGSaveOptions();
    jpegOptions.quality = 12;
    jpegOptions.embedColorProfile = true;
    jpegOptions.matte = MatteType.NONE;
    //save jpg as a copy:
    thedoc.saveAs((new File(folderString+"/"+basename+".jpg")),jpegOptions,true);

  • How to get uploaded file name and path in BefExportToDat event script

    I would like to get hold of the uploaded file name and full path in the event script "BefExportToDat", as I need to extract values from particular fields. However I have not yet found a way to do this.
    - The input variable "strFile" returns the .Dat file path in the Outbox, to which it is about to export the data. This is no use to me.
    - The API variable RES.PstrFilename is returning nothing
    I am using RES.PstrFilename in the "BefFileImport" event script in a different FDM application and it works fine, however I need to find a way to get this to work in the "BefExportToDat" event script.
    Please let me know how this might be achieved.

    I am looking through the API calls in FDM Workbench, but cannot see the table (tPOVPartitions) you mentioned listed. Is this the correct name? And do I just use the function listed in the object browser to run the query?
    Furthermore (going back to my initial thoughts of using strFile), it appears that although the variable contains the .Dat filename and path, the actual file is non-existent when "BefExportToDat" is executed:
    Error:
    Error: Export failed.
    Detail: File not found.
    This would make sense, but it does make the variable "strFile" a little pointless since one cannot make use of the file in this particular event script. Do you please have any thoughts on this?

  • Sharepoint 2010 -Script to get file name from Document Library

    Hi 
    can anybody send be script that works in "SharePoint 2010 management Shell" to get list of file names in document library.
    Thank

    See my updated answer. The double quotes need to be removed. Also note that you need to use $item.File.Name
    and not $item.Name to get the name of the files.
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

Maybe you are looking for

  • Using XML schema in a Java application

    Hi, I need to parse and use an XML schema in an application, mainly for helping a user to build an XPATH. For that, I want to use the Schema classes bundled with Oracle's parser. Is there any documentation about that ? Or are the source code availabl

  • Mail not responding after restored from TM

    I restored full data from a MacBook to a brand new MBP today using Time Machine.  Everything looks fine except for Mail. It simply doesn't respond.  I already deleted all accounts from System Preferences but when I close and open that screen, all acc

  • Viewers sdk setup help

    Hi guys, for a CRServer setup, I want to setup a jsp dev environment to query the enterprise bus for system objects and info objects, and view reports in html. What are the setup steps for my jsp servlet container to talk to my crystal reports server

  • Cisco Client + Dial up problems

    I am experiencing a difficult issue with the Windows Cisco VPN Client (4.6.02) The client connects fine over a cable broadband connection, but when connected over a dial up connection, the client generates a "Bad hash payload" type errorset. Can anyo

  • Simple Question about 'Monitor Clients' on WCS

    Hello When I use WCS and go the 'Clients' tab on the Home page and then click 'Associated Clients' it shows me a whole list of usernames/MAC adresses/ip addresses/ etc. One of these column titles is 'Protocol'. On some of my entries there is an AP wi