Find and replace with multiple files and with a watch folder

I am trying to create a watch folder that uses red_menace script to:
1. Have a folder that receives multiple xml files that run the script one by one.
2. then move the files to an output folder.
I tried modifying the set TheFIle to choose file -- the original text file to:
with multiple selections allowed
But that doesn't seem to work. I know i'm missing a step. Any help is much appreciated!
Thanks!
The way i'd like to setup things is having an input folder on the desktop (or just have the application on the desktop and I can drag the files onto it), and let it do it's thing. Once it's done have it export the xml files into an output folder.
Here's what i got so far:
on open
set TheFIle to choose file -- the original text file
set TheFolder to ("Macintosh HD:Users:user1:Desktop:out") -- the folder for the output file
set TheName to (GetUniqueName for TheFIle from TheFolder) -- the name for the output file
set TheText to read TheFIle -- get the text to edit
set Originals to {"KPCALDATE", "KPCALEVENT", "KPCALDAY", "KPCALBODY", "obituaries name", "" & return & "</cstyle></pstyle>" & return & "<pstyle name=\"obituaries text\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>", " .com", " .net", " .org", " .edu", "www .", "www. ", "Ho- nolulu", "<pstyle name=\"kicker 12\"><cstyle allcaps=\"1\">fashion news</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "<component name=\"Headline 1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline 1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 36\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>-", "-", "
Per serving:", "<pstyle name=\"Titlebar - mini, red\"><cstyle allcaps=\"1\">NATION & World </cstyle><cstyle allcaps=\"1\">Report</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "</cstyle></pstyle>"} -- the terms that can be replaced
set Replacements to {"subhed", "subhed", "subhed", "Normal", "obituaries text", ", ", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>
", ".com", ".net", ".org", ".edu", "www.", "www.", "Honolulu", "", "<component name=\"Headline1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 27\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>—", " —", "
Per serving:", "","" & return & "</cstyle></pstyle>"} -- the replacement terms
repeat with AnItem from 1 to count Originals
set TheText to (replaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
end repeat
try -- write a new output file
tell application "Finder" to make new file at TheFolder with properties {name:TheName}
set OpenFile to open for access (result as alias) with write permission
write TheText to OpenFile starting at eof
close access OpenFile
on error errmess
try
log errmess
close access OpenFile
end try
end try
end open
to GetUniqueName for SomeFile from SomeFolder
check if SomeFile exists in SomeFolder, creating a new unique name if needed
parameters - SomeFile [mixed]: a source file path
SomeFolder [mixed]: a folder to check
returns [text]: a unique file name and extension
set {Counter, Divider} to {"00", "_"}
-- get the name and extension
set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
if TheExtension is missing value then set TheExtension to ""
set TheName to text 1 thru -((count TheExtension) + 2) of TheName
set NewName to TheName & "." & TheExtension
tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
repeat while it contains NewName
set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
set NewName to TheName & Divider & Counter & "." & TheExtension
end repeat
end tell
return NewName
end GetUniqueName
to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
displays a dialog for multiple item edit (note that a return is used between each edit item)
for each of the items in SomeItems, a line containing it's text is placed in the edit box
the number of items returned are padded or truncated to match the number of items in SomeItems
parameters - SomeItems [list]: a list of text items to edit
TheTitle [boolean/text]: use a default or the given dialog title
ThePrompt [boolean/text]: use a default or the given prompt text
returns [list]: a list of the edited items, or {} if error
set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
if TheCount is less than 1 then return {} -- error
if ThePrompt is in {true, false} then -- "with" or "without" Prompt
if ThePrompt then
set ThePrompt to "Edit the following items:" & return -- default
else
set ThePrompt to ""
end if
else -- fix up the given prompt a little
set ThePrompt to ThePrompt & return
end if
if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
set TheTitle to "Multiple Edit Dialog" -- default
else
set TheTitle to ""
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
repeat with AnItem from 1 to TheCount -- pad/truncate entered items
try
set the end of TheItems to (item AnItem of TheInput)
on error
set the end of TheItems to ""
end try
end repeat
return TheItems
end EditItems
to replaceText of SomeText from OldItem to NewItem
replace all occurances of OldItem with NewItem
parameters - SomeText [text]: the text containing the item(s) to change
OldItem [text]: the item to be replaced
NewItem [text]: the item to replace with
returns [text]: the text with the item(s) replaced
set SomeText to SomeText as Unicode text -- TID's are case insensitive with Unicode text
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
set {ItemList, AppleScript's text item delimiters} to {text items of SomeText, NewItem}
set {SomeText, AppleScript's text item delimiters} to {ItemList as text, TempTID}
return SomeText
end replaceText
Message was edited by: gamebreakers

When you use the open or adding folder items to handlers, you need to add the parameters for the file items passed to them.
I'll go ahead and post the applet/droplet version of my original script from the previous topic for reference:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFEE80;
overflow: auto;"
title="this text can be pasted into the Script Editor">
-- search and replace multiple items applet/droplet/folder action
-- the terms to replace - edit as needed
property EditableItems : {¬
"one", ¬
"two", ¬
"three", ¬
"four", ¬
"five", ¬
"six", ¬
"seven", ¬
"eight", ¬
"nine", ¬
"ten", ¬
"eleven", ¬
"twelve", ¬
"thirteen", ¬
"fourteen", ¬
"fifteen", ¬
"sixteen", ¬
"seventeen", ¬
"eighteen", ¬
"nineteen", ¬
"twenty"}
-- the folder for the output file(s) - change as needed
property TheFolder : (path to desktop)
property LastEditItems : EditableItems
on run
the applet/droplet was double-clicked
open (choose file with multiple selections allowed)
end run
on open TheItems
items were dropped onto the applet/droplet
parameters - TheItems [list]: a list of the items (aliases) dropped
returns nothing
repeat with AnItem in TheItems
ReplaceMultipleItems from AnItem
end repeat
end open
on adding folder items to this_folder after receiving these_items
folder action - items were added to a folder
parameters - this_folder [alias]: the folder added to
these_items [list]: a list if items (aliases) added
returns nothing
repeat with AnItem in these_items
ReplaceMultipleItems from AnItem
end repeat
end adding folder items to
to ReplaceMultipleItems from SomeFile
replace multiple text items in SomeFile
parameters - SomeFile [alias]: the file to replace items in
returns nothing
set TheName to (GetUniqueName for SomeFile from TheFolder) -- the name for the output file
set TheText to read SomeFile -- get the text to edit
set Originals to (choose from list EditableItems default items LastEditItems with prompt "Select the terms to replace:" with multiple selections allowed) -- the specific terms to replace
set LastEditItems to Originals
set Replacements to (EditItems of Originals with Title given Prompt:"Edit the following replacement terms:") -- the replacement terms
repeat with AnItem from 1 to count Originals
set TheText to (ReplaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
end repeat
try -- write a new output file
tell application "Finder" to make new file at TheFolder with properties {name:TheName}
set OpenFile to open for access (result as alias) with write permission
write TheText to OpenFile starting at eof
close access OpenFile
on error errmess
try
log errmess
close access OpenFile
end try
end try
end ReplaceMultipleItems
to GetUniqueName for SomeFile from SomeFolder
check if SomeFile exists in SomeFolder, creating a new unique name if needed
parameters - SomeFile [mixed]: a source file path
SomeFolder [mixed]: a folder to check
returns [text]: a unique file name and extension
set {Counter, Divider} to {"00", "_"}
-- get the name and extension
set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
if TheExtension is in {missing value, ""} then
set TheExtension to ""
else
set TheExtension to "." & TheExtension
end if
set {NewName, TheExtension} to {TheName, (ChangeCase of TheExtension to "upper")}
set TheName to text 1 thru -((count TheExtension) + 1) of TheName
tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
repeat while it contains NewName
set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
set NewName to TheName & Divider & Counter & TheExtension
end repeat
end tell
return NewName
end GetUniqueName
to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
displays a dialog for multiple item edit (note that a return is used between each edit item)
  for each of the items in SomeItems, a line containing it's text is placed in the edit box
    the number of items returned are padded or truncated to match the number of items in SomeItems
parameters - SomeItems [list]: a list of text items to edit
TheTitle [boolean/text]: use a default or the given dialog title
ThePrompt [boolean/text]: use a default or the given prompt text
returns [list]: a list of the edited items, or {} if error
set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
if TheCount is less than 1 then return {} -- error
if ThePrompt is in {true, false} then -- "with" or "without" Prompt
if ThePrompt then
set ThePrompt to "Edit the following items:" & return -- default
else
set ThePrompt to ""
end if
else -- fix up the given prompt a little
set ThePrompt to ThePrompt & return
end if
if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
set TheTitle to "Multiple Edit Dialog" -- default
else
set TheTitle to ""
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
repeat with AnItem from 1 to TheCount -- pad/truncate entered items
try
set the end of TheItems to (item AnItem of TheInput)
on error
set the end of TheItems to ""
end try
end repeat
return TheItems
end EditItems
to ReplaceText of SomeText from OldItem to NewItem
replace all occurances of OldItem with NewItem
parameters - SomeText [text]: the text containing the item(s) to change
OldItem [text]: the item to be replaced
NewItem [text]: the item to replace with
returns [text]: the text with the item(s) replaced
set SomeText to SomeText as text
if SomeText contains OldItem then
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
try
set {ItemList, AppleScript's text item delimiters} to {text items of SomeText, NewItem}
set {SomeText, AppleScript's text item delimiters} to {ItemList as text, TempTID}
on error ErrorMessage number ErrorNumber -- oops
set AppleScript's text item delimiters to TempTID
error ErrorMessage number ErrorNumber
end try
end if
return SomeText
end ReplaceText
to ChangeCase of SomeText to CaseType
changes the case or capitalization of SomeText to the specified CaseType using Python
parameters - SomeText [text]: the text to change
CaseType [text]: the type of case desired:
"upper" = all uppercase text
"lower" = all lowercase text
"title" = uppercase character at start of each word, otherwise lowercase
"capitalize" = capitalize the first character of the text, otherwise lowercase
returns [text]: the changed text 
set SomeText to SomeText as text
if CaseType is not in {"upper", "lower", "title", "capitalize"} then return SomeText
return (do shell script "/usr/bin/python -c \"import sys; print unicode(sys.argv[1], 'utf8')." & CaseType & "().encode('utf8')\" " & quoted form of SomeText)
end ChangeCase
</pre>
Edit: how does the choose from list dialog handle those big strings? I'm guessing not very well - is that why you avoided using them?
Message was edited by: red_menace

Similar Messages

  • How do I find and open the CD folder on a 13" macbook pro??

    How do I find and open the Cd folder on a 13" macbook pro , so I can read the content on the cd with pages.

    If the CD is not showing on the desktop, go to Finder on the menu bar, Preferences, General and check the box for CDs, DVDs,and iPods.  Then double click the image of the CD on the desktop to open and display the contents of the CD.

  • Message "New files found in your watched folder".

    I keep getting a message "New files found in your watched folder".  But it shows me old files. If I say I want to download them, it tells me it cannot.
    PE 11   Windows 7

    Watch folders is a function of the Elements Organizer, it has nothing to do with the Editor half of the program.
    Do you want to use Watched Folders? If not, disable them by going to File > Watch Folders, then uncheck the "Watch Folders and their Sub-Folders for New Files" option. If you want to use the option, try creating a new folder and set that up as the watched folder and place your images there. The Watch Folders option can get messed up if the folder has images already in it when it is set up.

  • [Perm] Find something, replace with nothing?

    I need to remove tags from a manuscript. In PageMaker I was able to search for:
    <A>
    and replace with:
    [nothing]
    This automated the process of deleting the extraneous text. However in InDesign, leaving the "Replace" field blank does not delete text. So there is seemingly no way to automated this deletion (in one step at least).
    Any suggestions would be appreciated.
    --Stephen

    Here you go. This script processes the selected story (either put your text cursor in the story or select one of its frames) and interprets PageMaker-like paragraph style tags.
    If you have no tags, the paragraphs will all be left with "No Paragraph Style" so don't run it against a previously processed story.
    If you don't tag a paragraph in the middle of the story, it will assume the style of the previous paragraph.
    The script creates styles on the fly if they don't already exist.
    If a paragraph starts with a "<" but has no ">" it's treated like a paragraph with no tag. Same for one that is tagged "<>".
    I've not exactly tested it thoroughly, but it looks as though it works.
    Warning: this version has a bug corrected two messages later.
    tell application "InDesign 2.0.1"
    set theStory to parent of selection
    if class of theStory is story then
      set theLim to count of paragraphs of theStory
      set theStyles to name of every paragraph style of document 1
      set curStyle to "[No paragraph style]"
      repeat with n from 1 to theLim
       set theChar to character 1 of paragraph n of theStory
       copy curStyle to theStyleName
       if theChar = "<" then
        set theText to contents of paragraph n of theStory
        set theOffset to (offset of ">" in theText)
        if theOffset > 2 then
         set theStyleName to characters 2 through (theOffset - 1) of theText as string
         if theStyleName is not in theStyles then
          tell document 1
           set newStyle to make paragraph style
          end tell
          set name of newStyle to theStyleName
          copy theStyleName to end of theStyles
         end if
         delete characters 1 through theOffset of paragraph n of theStory
        end if
       end if
       set applied paragraph style of paragraph n of theStory to paragraph style theStyleName of document 1
       copy theStyleName to curStyle
      end repeat
    end if
    end tell
    Dave

  • Searching for multiple files to put into same folder

    Hello,
    I have a group of folders each containing low resolution images. I would like to create a group of new folders with the exact folder organization with the exact files in each folder but the folders should contain the high resolution images. Currently the high resolution files are all mixed together in a few folders on my external hard drive.
    I'd like to simply open the low-resolution folders, do a select-All, and somehow use those file names in a mass search of the high res folders, but I'm not sure if it's possible or how to do it.
    I am using OS 10.4.11
    Any help would be appreciated.
    Message was edited by: ccumminskc

    O.K. I think i figured out a backdoor way to do this. I'm open to easier methods.
    This is 500 or so files I'm trying to organize so doing each one by one was not going to be good for my sanity.
    In the Finder I selected all the files in that low res image folder who's organization and contents I wanted to mimic in the new high res folder. I control clicked and did the "Copy All" item on the dialog.
    From there, I opened TextEdit, pasted the file names to a new text document. The list is a descending list with each file name separated by a line break (or "carriage return" they used to call them.) I carefully moused to the beginning of one file name and selected the space before the first letter of the file name and selected the empty space until the last letter of the previous file name. It should be nothing but blank space selected. I copied that, clicked "Find" on the TextEdit menu. I selected the Find space, put my cursor in there and pasted into the space. In the "Replace" space I type " or " and clicked "Replace All."
    This prepared a lengthy text section featuring all of the file names ready to be entered into a Boolean search. I used EasyFind from www.devon-technologies.com to do a boolean search of the high-resolution folders and Bingo, there they are ready to be put into their new home.
    Whew.... if anyone cares.... or has an easier method I am all ears.

  • Help needed with a watch folder

    good morning,
    Im doing a workbench process to remove my paswords and extended privs on a given PDF and then send the final copy to my desktop.
    Right now i have it working except for the part where i want the watchFolder to dump the result on my desktop.
    Can i do that from workbench, sending a result to the desktop?
    Thechically i would like for anyone using this process to endup with a copy of that PDF (all striped down) on their desktop.
    right now i have it set to "result/" and going in that folder, i can see that PDF i need. I was wondering if i can send the result to the desktop instead.
    Thank you very much,
    PAtrick

    Not sure about the feasibility of putting it on desktop but your watched folder could be a network(shared) folder which could be accessed by all on the network.
    Thanks,
    Wasil

  • How to define a Rights Management process "Protect Document" with an watched folder?

    Hello.
    I try to build a process in Workbench 11.0, that uses the Protect Document operation of Rights Management.
    The process should use a watched folder as start point.
    My problem is, how to fill the operations parameters (Input Doc, Document name, Policy set name, Policy name, ...)
    Jürgen

    First -- by default iTunes stores its Library in "My Documents\My Music\iTunes\iTunes Library.itl", and its Music in "My Documents\My Music\iTunes\iTunes Music\".
    Make sure you have a "iTunes Library.itl" after the restore -- if not, and your backup software supports it, try an older version of the file. If your backup software only keeps the last version of the file -- well, then you are SOL, and you will have to re-add the files to the Library. You will also have to rebuild your playlists, ratings, etc.
    Since you have "very few files" in the iTunes Music directory -- either you weren't storing your music there, or your backup didn't work. Are you sure you weren't using a non-default location for your music files?
    If you had a hardware problem then it is likely that your backup stopped working properly at some point. This is why you need a rotating backup scheme and periodic archiving of files to non-writeable media (If you have the time/money)

  • I want to read the content of a text file dropped in a watched folder into a string variable

    I have a workbench process with 2 variable.
    inDoc (DataType=Document/input/required)
    outStr (DataType = String/output)
    The document being passed to the workflow is a text file with 4 lines of text in it.  when the text file is dropped into the watched folder, it will be assigned to the inDoc parameter in the workflow.
    My workflow needs to extract the 4 lines of text and write it into a string (outStr).
    Id like to use the FileUtilsService.ReadString service but i can't since its input parameter is the file path.  When i do, i get the following error...
    Caused by: ALC-FUT-001-011: File rO0ABXNyABZjb20uYWRvYmUuaWRwLkRvY3VtZW50yAEFUxsO+CEDACNJAAtfY2FsbGJhY2tJZFoADV9kZXNlcmlhb Gl6ZWRJABBfZGlzcG9zYWxUaW1lb3V0WgAJX2Rpc3Bvc2VkWgAZX2lzRGlzcG9zYWxUaW1lb3V0RGVmYXVsdFoAE19 pc1RyYW5zYWN0aW9uQm91bmRKAAdfbGVuZ3RoSQAOX21heElubGluZVNpemVaAAhfb3duRmlsZVoAC19wYXNzaXZhd GVkWgALX3BlcnNpc3RlbnRJABFfc2VuZGVyQ2FsbGJhY2tJZFoAEV9zZW5kZXJQYXNzaXZhdGVkWgARX3NlbmRlclB lcnNpc3RlbnRJAA5fc2VuZGVyVmVyc2lvbkkABl9zdGF0ZUwAC19hdHRyaWJ1dGVzdAATTGphdmEvdXRpbC9IYXNoT WFwO0wACF9jYWNoZUlkdAAfTGNvbS9hZG9iZS9pZHAvRG9jdW1lbnRDYWNoZUlEO0wADF9jYWxsYmFja1JlZnQAIUx jb20vYWRvYmUvaWRwL0lEb2N1bWVudENhbGxiYWNrO0wADF9jb250ZW50VHlwZXQAEkxqYXZhL2xhbmcvU3RyaW5nO 0wAC19kYXRhQnVmZmVydAAeTGNvbS9hZG9iZS9zZXJ2aWNlL0RhdGFCdWZmZXI7TAAPX2V4cGlyYXRpb25UaW1ldAA QTGphdmEvbGFuZy9Mb25nO0wABV9maWxldAAOTGphdmEvaW8vRmlsZTtMABBfZ2xvYmFsQmFja2VuZElkdAAhTGNvb S9hZG9iZS9pZHAvRG9jdW1lbnRCYWNrZW5kSUQ7WwAHX2lubGluZXQAAltCTAAMX2lucHV0U3RyZWFtdAAVTGphdmE vaW8vSW5wdXRTdHJlYW07TAAPX2xvY2FsQmFja2VuZElkcQB+AAhMAAxfcHVsbFNlcnZhbnR0ACRMY29tL2Fkb2JlL 2lkcC9JRG9jdW1lbnRQdWxsU2VydmFudDtMABFfcmFuZG9tQWNjZXNzRmlsZXQAGkxqYXZhL2lvL1JhbmRvbUFjY2V zc0ZpbGU7TAAVX3NlbmRlckNhbGxiYWNrUmVmSU9ScQB+AARMABZfc2VuZGVyR2xvYmFsQmFja2VuZElkcQB+AAhMA A1fc2VuZGVySG9zdElkcQB+AARMABVfc2VuZGVyTG9jYWxCYWNrZW5kSWRxAH4ACEwAGl9zZW5kZXJQdWxsU2VydmF udEpuZGlOYW1lcQB+AARMAARfdXJsdAAOTGphdmEvbmV0L1VSTDt4cHcGAAAAAwAAcHd1AHMwOjA6MDowOjA6MDowO jEvMTI3LjAuMC4xLy8vLy8vLy8vZmU4MDowOjA6MDo3NDMyOmU0OWQ6NmUzMToxNTU0JTEwLzEwLjI0LjIzOS4xMjY vZmU4MDowOjA6MDowOjVlZmU6YTE4OmVmN2UlMTEvLy8vdXIAAltCrPMX+AYIVOACAAB4cAAAAcRJTU01MjU3XzAxL TIwMTFfMXwwMXx8YXx8fHxGZW1hbGV8MjAwMHw2fDh8Y3wyNTZ8MjU2fDkxMnwwMXx8fHx8fHx8Tnx8fHx8fHx8fHx 8fHx8fHx8fHxZfHx8fHx8fHx8fDAyfHx8fHx8TnwyMDEyfDJ8MTR8DQpJTU01MjU3XzAxLTIwMTFfMnx8fHx8fHx8f Hxhc2RmfDI1NnwyMDEyfDAyfDAxfDIwMTJ8MDN8MDJ8fHx8YXxhfDI1Mnx8fHxZfHx8fHx8fHx8fHx8fHx8DQpJTU0 1MjU3XzAxLTIwMTFfM3xOfHx8fHx8fHx8fDIwMDB8Nnx8fGFzZGZ8YXNkZnxhc2RmfDI1Nnx8fHx8fHx8fHx8fHx8f Hx8fHx8DQpJTU01MjU3XzAxLTIwMTFfNHxOfE58fE58TnxOfHxOfE58fE58TnxOfA0KSU1NNTI1N18wMS0yMDExXzV 8U2luZ2xlfDAxfHwyMDEyfDAyfDE4fDIwMTJ8MDN8MDN8MjM0fGFzZGZ8fGFzZGZhc3x8fHxFeGNoYW5nZS1Qcm8uO S40MDEuRnVsbC5XSU4uZW5fQ0EuRU5VLTEwLTIwMTF8DQoNCnBwdwYAAAAAAAB0AAp0ZXh0L3BsYWlucHNyABFqYXZ hLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAA AADdAAKd3NmaWxlbmFtZXQAJ0M6XFVzZXJzXENodWxseS5QYXJrXERlc2t0b3BcaGRzY2FuLnR4dHQACGJhc2VuYW1 ldAAKaGRzY2FuLnR4dHQABGZpbGVxAH4AFXh3NwAtYWRvYmUvaWRwL0RvY3VtZW50UHVsbFNlcnZhbnQvYWRvYmVqY l9MQ19ERVYx//////////94 does not exist.
    at com.adobe.livecycle.fileutils.FileUtilsService.readDocument(FileUtilsService.java:363)
    which is what i expected...
    I've also tried with the Script.executeScript to call some java code but im not too strong in java and in all the examples i find, the file pointer requires a file path.
    import java.io.*;
    FileInputStream f = new FileInputStream(patExecContext.getProcessDataValue("/process_data/inDoc"));
    OR
    File f = new File(patExecContext.getProcessDataValue("/process_data/inDoc"));
    OR
    File f = patExecContext.getProcessDataValue("/process_data/inDoc");
    Any clue how to resolve my problem?

    Try the following code snippet to read the String content from the file recieved through watched folder endpoint.
    com.adobe.idp.Document inputDoc = patExecContext.getProcessDataDocumentValue("/process_data/inDoc");
    java.io.InputStream inStream = inputDoc.getInputStream();
    byte[] dataBuffer = new byte[inStream.available()];
    inStream.read(dataBuffer);
    String strData = new String(dataBuffer);
    patExecContext.setProcessDataStringValue("/process_data/outStr",strData);
    The code is not tested, hence if you find any mistakes, correct and test the functionality.
    Nith

  • Windows 8.1 (64) What is contained in the Machiekey folder and what would happen if it was renamed and replaced with an empty folder?

    Microsoft support engineer, Mohamed Ameen, suggested I post this question/problem here.
    I have a Windows 8.1 (64) PC that has a problem with a phantom or ghost Homegroup that is preventing it from becoming a part of a Homegroup on my home LAN. The Homegroup troubleshooter utility and all of the standard troubleshooting suggestions online have
    been of no help.
    I found this thread ("http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/homegroup-wont-go-away-ghost-group-on-whole/8a4f464f-e461-47aa-af05-07a4fd4875fd") which suggests replacing the Machinekeys folder, but it has very little
    in the way of instructions on how to completely perform the "repair" and/or the risks of causing other OS and program failures.
    I have added additional information and screen shots to the thread I started on the Microsoft Community site and rather than repeating all of that I thought it would be easier to include a thread to that discussion: (http://answers.microsoft.com/en-us/windows/forum/windows8_1-networking/what-is-contained-in-the-machinekeys-folder/d7fb5189-e8c2-4ec8-ba2f-9e4e53905703

    Hi,
    For this problem, you can try to use Process Monitor the trace when creating HomeGroup on XPS PC, then find the reason of this problem.
    You can access to the link below to download Process Monitor:
    https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
    How to capture a Process Monitor trace:
    http://blogs.msdn.com/b/dswl/archive/2010/01/10/how-to-capture-a-process-monitor-trace.aspx
    Learning Example:
    Using Process Monitor to Troubleshoot and Find Registry Hacks:
    http://www.howtogeek.com/school/sysinternals-pro/lesson5/all/
    Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • No Finder and renaming the "DivXNetworks" folder does not work.  What now??

    I just upgraded to 10.5 on my MacBook and I am having the same finder issues discussed in the following thread:
    http://discussions.apple.com/thread.jspa?threadID=1197076&tstart=15
    But when I try the suggested solution, I am being told that I do not have the DivXNetworks folder.
    Does anyone have another solution to get finder to work?
    Thanks in advance.
    Eric
    P.S. - I am a relative novice at this so a Mac for Dummies solution would be best

    The Keyboard Viewer may help you determine what key-faces also may double as something else, as you can choose to shift their purpose through use of the fn key. In the keyboard & mouse system preference panel you can choose to view this in the top of the main finder desktop menu bar. With options. You also may choose to assign a key to a different function or symbol.
    However I see my MacBook has a key which sports both + and = on the same keyface.
    Good luck & happy computing!

  • How do I name output files based on files processed from a watched folder?

    Hello!
    I've built a small process to merge XML files with XDP templates, generating PDF files at the end of the process.
    Right now the process is generating all files with a fixed name + a random number, as defined in the Input panel (literal value with option "Appen a suffix..." checked.
    I'd like to change this so the resulting files have the same name as the input files, changing only the extension (PDF instead of XML).
    I believe I should change from literal value to XPath expression, in order to build the resulting name based on the input file name.
    QUESTION: what function should I use to get the input file name in XPath builder (if this is the right place to do it) ?
    I tried with:
         getDocAttribute(/process_data/@docApolicesXML,"wsfilename")  + ".PDF"
    Does not work.
    Thanks a lot for any hints!
    Marcos

    Hi Marcos,
    You should do the following:
    Create new variable "filename"
    And in a Set value you should:
    filename = getDocAttribute(/process_data/@docApolicesXML,"basename")
    filename = concat(/process_data/@filename,".pdf")
    This will give you "myFile.xml.pdf - if you want myFile.pdf instead, you need to do this in the Set value:
    filename = getDocAttribute(/process_data/@docApolicesXML,"basename")
    filename = substring-before(/process_data/@filename,".xml")
    filename = concat(/process_data/@filename,".pdf")
    That should do it :-)
    Kim Christensen
    Dafolo A/S
    Denmark

  • Using automator to edit text - find and replace

    Hello. I have a huge database of tv repair tips. Unfortunately, when i started to accumulate the tips I put them in an html table like this:
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">36XBR400 </td>
    <td class="NoiseDataTD">DEAD - NO H.V. - INTERMITTENT START UP - 'D Board' NG. </td>
    <td class="NoiseDataTD">IC6501, MCZ3001D 0r MCZ3001DB(8-759-670-30) - >>>HARD TO REPLACE!---tip:CUT PINS FROM TOP THEN PULL OUT SLOWLY </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">63A </td>
    <td class="NoiseDataTD">INSUFFICIENT HEIGHT </td>
    <td class="NoiseDataTD">CHECK C522 REPLACE IF PARTIALLY OR COMPLETELY OPEN </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2 </td>
    <td class="NoiseDataTD">Int. loss of pix (HV) after 10 Min. Audio Normal.Pwr up again & OK for 10Min </td>
    <td class="NoiseDataTD">H Protect Circuit. D521 (7.5 zener) ECG5015 </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2D </td>
    <td class="NoiseDataTD">VERTICAL HEIGHT PROBLEM </td>
    <td class="NoiseDataTD">BAD YOKE: BAD YOKE WINDINGS MEASURED 6 OHMS, SHOULD BE CLOSE TO 9 OHMS </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2W </td>
    <td class="NoiseDataTD">Negative main pix, pip video ok. Customer heard pop then pix went dark. </td>
    <td class="NoiseDataTD">IC355. CSA2131S </td>
    </tr>
    Now, I want to input the tips into a MySQL database with an insert statement like:
    INSERT INTO `otips` (`id`, `brand`, `model`, `problem`, `solution`, `user`, `date`) VALUES (NULL, UCASE('SONY'), UCASE('KP-53XBR200'), UCASE('CONVERGENCE OFF'), UCASE('REPLACED CONVERGENCE IC''S STK392-020 AND PICO FUSE PS5007 3.15 AMP open'), '0', '0000-00-00');
    I've been all over the help files and different websites with tutorials and I cannot figure out how to do this using automator. Could anyone tell me if this can be done with automator and perhaps point me in the right direction.
    Thanks,
    daniel
    IMac Intel Core Duo   Mac OS X (10.4.8)  

    Are you familliar with regular expressions? If you are, then you can create a shell script and incorporate it into your workflow. Or you could use bbedit or textwrangler from barebones.com to search and replace in multiple files.

  • Watch Folder to Overwrite Sequence Files? – Templated Project with Custom Images

    So I want users to be able to upload an image to my server, have it added to a video, and rendered out and served to them.  Simple right?  Maybe my workflow needs adjustment:
    I have a project saved with an image sequence render queued, and a subsequent movie file render (of the image sequence) queued and collected. (the image sequence is to utilize multi-machine rendering because of intense effects, etc.)  When a user uploads an image, the server duplicates this template-project collected folder.  The project has a placeholder image that is replaced by the user's uploaded image (into the footage folder).  The server then drops it all in a watch folder for multi-machine rendering.  The sequence renders and the movie renders just fine!  All good.
    The only PROBLEM is that when the second instance comes along, "skip existing files" is checked (by necessity to use the multi-machine function) and therefore just keeps the existing image sequence without overwriting.  Every instance of the project is just a duplicate, and so has the same target path for the image sequence.  So the subsequent movie file comes out the same as the first.
    So how can I either:
    1) force overwriting the image sequence
    2) automate unique directories for each image sequence render – without physically opening the project to specify a different target path
    -or- 3) move/delete the image sequence folder AFTER movie render, but BEFORE another watch folder render (considering multiple queued projects in the watch folder at once).
    An ideas??  Thanks!!!

    > So is there a way to automate importing the image sequence through aerender and tell it to render a movie?
    Are you familiar with post-render actions? They exist to do this kind of thing.
    Here's a relevant excerpt from After Effects Help:
    http://helpx.adobe.com/after-effects/using/basics-rendering-exporting.html#post_render_act ions
    "Use the Import & Replace Usage option to create a chain of dependent render items. For example, you can set one render item to use a watch folder and multiple computers to create a still-image sequence, and then the next render item can render a single movie file from that still-image sequence"

  • How to combine multiple files in CS6

    I am trying to combine multiple files-- book chapters-- into a single editable document in CS6. Tutorials apprea outdated

    following on from Sandee Cohen's post no.18, the location of the script has moved to:
    http://www.simonwiscombe.com/indesign-merging-all-files/
    and it is worth noting that the script initially merged files that were all 1pp long each.
    Simon did make a modification to it later on in the article so that the script would merge files of all lengths, but when I ran the script, it produced an error to do with line 18. The line:
    var sourceFolder = Folder.selectDialog(“Select a folder with source InDesign files.”);
    needs to be replaced with
    var sourceFolder = Folder.selectDialog('Select a folder with source InDesign files.');
    (double quotes were swapped out for single quotes)
    I have only tested the script with varying page lengths with minimal objects on the pages to determine if the files merged. So far so good. The earlier version that merged 1pp files only would fail if fonts/links were missing as any dialog box upon opening seems to interfere with the script. I feel that the newer script will do the same thing.
    I know this is an older thread but given I just had the same experience, I thought the revised script would help a few people.
    Colin

  • Any Tutorial / Sample to create Single PDF from multiple source files using PDF assembler in a watched folder process.

    Any Tutorial / Sample to create Single PDF from multiple source files using PDF assembler in a watched folder process. I have a client application which will prepare number of source files and some meta data information (in .XML) which will be used in header/footer. Is it possible to put a run time generated DDX file in the watch folder and use it in Process. If possible how can I pass the file names in the DDX. Any sample Process will be very helpful.

    If possible, make use of Assembler API in your client application instead of doing this using watched folder. Here are the Assembler samples :  LiveCycle ES2.5 * Programming with LiveCycle ES2.5
    Watched folder can accept zip files (sample : Configuring a watched folder to handle multiple input files and write results to a single folder | Adobe LiveCycle Blog ). You can also use execute script to create the DDX at runtime : LiveCycle ES2 * Application Development Using LiveCycle Workbench ES2
    Thanks
    Wasil

Maybe you are looking for

  • Takes long time  to open exported HTML

    I've set up my exported HTML captivate project to run after 10% is loaded, but I'm seeing strange/funny behavior: -Preload screen shows for approx 10 secs (this is fine) -Then first slides is displayed (good so far) -Then everything hangs for 45-60 s

  • Webi Vs Bex Analyzer for the same query

    Hi Experts , I face an issue in Webi Vs Bex Analyzer for the same query : Output of Bex query: Transport System     Location ID     Quantity PIPEC1-Z4          LOCCP1-Z4     1,000.000 BBL                           LOCCP2-Z4     400 TO                

  • Convert mp3 to aiff

    i imported songs into itunes as mp3.how can i convert them to aiff and i done tried setting preferances,hit convert to aiff and its not working.at least if it did the show info still says mp3.if i burn the mp3 through itunes set on audio does that co

  • After clean install of ML 10.8 I am unable to install my Logic Studio 9 Box Set

    I recently did a clean install of ML 10.8 (on version 10.8.2) on my iMac (did a HDD upgrade) When I now try to install my Logic Studio Box Set from the disc I get this error... I don't know of a way to upgrade to the APP Store version from my serial

  • LabVIEW 2012 crashes on different File Open/Save dialogs, if last working directory no longer exists

    On several Windows 7, 64 bit machines, if I open LV2012 SP1 f1 64 bits, create a VI and save it on a directory, exit LabVIEW, delete the directory where I saved the VI, restart LabVIEW and do a File/Open, LabView goes puff and disappears. Sometimes i