Folder script to print folder content automator

Hi,
I had a folder script that printed any document added to a folder and when printed, then it deleted the document.  That script help me to print from an OS 9 emulator  (SheepShaver) through OS X.
For I don't know the reason, the folder script does not work anymore.  It could be Yosemite or my new iMac upgrade.  Find out ?  And Apple Script is far away in my mind ... so I am not really sure what is going wrong.
I would like to have the script to print from any folder it is assigned to, instead of applying to only one folder.  Can you help ?   Here is the actual folder script:
property myPrinter : "HP_Officejet_8500" -- Le nom exact de l'imprimante est obtenu en faisant «lpstat -p» dans terminal.
property filesFolderName : "Nous/Documents/SheepShaver/Données/En impression" -- Déterminer le chemin du dossier contenant les fichiers à imprimer.
property fileStamp : ""
property theFilePath : ""
on adding folder items to thisFolder after receiving theseItems
          -- Définir le chemin du dossier contenant les fichiers à imprimer.
          set filesFolderPath to POSIX path of (path to users folder) & filesFolderName & "/"
          -- Pour chaque fichier dans le dossier ...
          repeat with i in theseItems
                   -- ... définir les informations du fichier; ...
                   set {name:fileName, name extension:fileExt} to info for i
                   -- ... définir l'estampe du fichier (date et l'heure), ...
                   --set fileStamp to do shell script "/bin/date +'('%d-%m-%y' '%HH%MM%S')'"
                   -- ... définir le chemin du fichier, ...
                   set theFilePath to quoted form of (filesFolderPath & fileName)
                   -- ... et enfin, l'imprimer sur l'imprimante choisie.
                   do shell script "usr/bin/lpr -P " & myPrinter & space & theFilePath
                   do shell script "/bin/sleep 10"
                   -- ... détruire le fichier imprimé.
                   do shell script "/bin/rm " & theFilePath
                   get theFilePath
          end repeat
end adding folder items to
Thanks in advance.
Robert Lespérance

You would think this would work, remember universal access - enable access must be on.
tell application "System Events"
tell application "Finder" to activate
tell process "Finder"
keystroke "a" using command down
keystroke left using command down & option down
end tell
end tell
The Select All works, but the collapse all doesn't
CE Quickkey will do it with ease but that $80us a machine
http://www.cesoft.com/products/qkx.html
you could try the OS X scripting addition but it shareware and want money too and I don't know if it will work
http://osaxen.com/files/extrasuites1.1.html
Must be a free OS X scripting addition (osaxen) that does keystokes
good luck.

Similar Messages

  • Use Automator to move files and folder structure to another folder, retaining destination contents

    I have been struggling trying to setup Automator to move files and folder structure to another folder, retaining the destination contents.  Basically, I need to add files at the destination, within the same folder structure that exists at the source.  Here's some details about the scenario:
    -I have PDF files that I create on a seperate computer than I my daily use machine
    -For security reasons, the source computer doesn't have access to any shares on the destination computer
    -The destination computer has access to shares on the source computer
    -I want to delete the original PDFs at the source after they are moved or copied
    I haven't been able to get Automator to move or copy the folder contents (files and subfolders) without dropping everything copied at the top level of the destination, resulting in many duplicate folders and a broken folder structure.
    So far I've only had luck getting this to work at the command line, but I'd really like to have this setup in Automator so that I could have either a service or application that I could use for any folder, prompting for the source and destination folders.  I'm a relatively new Mac user with limited Linux experience, so this is the command that I've cobbled together and currently accomplishes what I'm looking for:
    ditto /Volumes/SMB_Temp/SOURCE ~/Desktop/Documents/DESTINATION
    cd /Volumes/SMB_Temp/SOURCE
    find . -type f -name "*.pdf" -exec rm -f {} \;
    Thanks for any ideas!

    If you have a command-line syntax that works, why not just create an Automator workflow with a single 'Utilities -> Run Shell Script' action, where that action has your (working) shell commands?
    Seems way, way simpler to me than trying to reinvent the wheel and transcribe shell commands into individual Automator actions

  • Apple script to copy folder contents

    I am looking for help to create an apple script, or automator task that will copy the contents of a specified folder and paste them into another specified folder. There will just be a couple of files within this folder, and each time it creates the duplicate I dont want it to erase pervious copies already created within the destination folder, so it will probably need to change the name of the file (....1, ...2, ....3, something like that).

    I tried setting up this automator app
    You have to drop folder A onto the app ignored for it to do it's thing. Dropping folder A
    on to it 3 times in a row gives this in folder B.
    You can experiment with the app to get what you want.  One should be able to create that script as a folder Action so that any file dropped into folder A will automatically get copied to folder B.  I was unable to get that to work.  Maybe someone with more experience with Automator can help in that area.

  • CF scripts not consistently listing contents of folder

    Hello.
    I upload multiple types of files to the server. Sometimes
    they are folders, word docs, ppts, pdfs or xls files. There is a
    script that runs that is supposed to list everything that I have
    uploaded into a directory. The problem is, it does not work
    consistently. Sometimes it will display all files, subdirectories,
    files within, sometimes it will say that nothing is there. I am not
    sure why it will work with some files/folders, and won't with
    others. Some folders work great, some don't. It may be a
    permissions problem, I'm not sure...
    Here's an example - I have a folder and a word document in
    the "root" files directory. When viewing in the browser, it
    displays "No Files Found". Then if I move a ppt back a directory -
    to the root, all 3 items (word doc, folder and ppt) will then show
    in the browser. For some reason the ppt triggers everything to
    suddenly show. This "magical" ppt does not work for every directory
    though. Some items just won't show no matter what.
    Here's a sample script that lists the contents of the
    directory:
    <cfinclude template="../usercheck.cfm">
    <cfparam name="URL.module" default="">
    <cfparam name="URL.file" default="">
    <cfparam name="URL.action" default="">
    <HTML>
    <HEAD>
    <TITLE>Title</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
    charset=iso-8859-1">
    <link href="../links.css" rel="stylesheet"
    type="text/css">
    <!-- End Preload Script -->
    <style type="text/css">
    <!--
    .style3 {color: #FFFFFF; font-weight: bold; }
    .style6 {font-size: 10px}
    -->
    </style>
    </HEAD>
    <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0
    MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();">
    <a href="/index.html"><img src="/Images/graphic.gif"
    width="169" height="84" border="0"></a>
    <br>
    <cfset pathn =
    "#getDirectoryFromPath(cgi.PATH_TRANSLATED)#files">
    <CFIF (URL.file IS NOT '')>
    <CFDIRECTORY ACTION="LIST"
    DIRECTORY="#pathn##urldecode(url.module)#"
    NAME="FileCheck"
    FILTER="#URL.file#">
    <cfif URL.action eq "Delete">
    <CFIF FileCheck.RecordCount GT 0>
    <cffile file="#pathn##urldecode(url.module)##URL.file#"
    action="delete">
    <cflocation
    url="module.cfm?module=#URLEncodedFormat(url.module)#">
    </CFIF>
    <cfelse>
    <CFIF FileCheck.RecordCount GT 0>
    <!--- <cfhttp
    method="Get"
    url="#getdirectoryfrompath(pathn)##URL.file#"
    path="#pathn#"
    file="#URL.file#"> --->
    <CFHEADER
    NAME="content-disposition"
    VALUE="attachment; filename=#URL.file#">
    <CFCONTENT type="application/unknown"
    file="#pathn##URLdecode(url.module)##URL.file#"
    DeleteFile="No"></CFCONTENT>
    </CFIF>
    </cfif>
    <cfelse>
    <CFDIRECTORY ACTION="LIST"
    DIRECTORY="#pathn##urldecode(url.module)#"
    NAME="dirlist">
    <table width="487" border="0" align="center">
    <tr bgcolor="#004B8D">
    <td width="479" height="36"><span
    class="style3"> Physician Modules
    </span></td>
    <td></td>
    </tr>
    <cfif #dirlist.recordcount# gt 2>
    <CFOUTPUT QUERY="dirlist">
    <CFIF type IS 'File'>
    <tr bordercolor="##D5EBFF" bgcolor="##D5EBFF">
    <td width="479" bordercolor="##D5EBFF" bgcolor="##F4FAFF"
    class="links">
    <span class="style6"><a
    href="#cgi.SCRIPT_NAME#?module=#URLEncodedFormat(url.module)#&file=#name#"> #left(name,le n(name)-4)#</a></span>
    </td>
    <td width="50" bgcolor="##FFFFFF">
    <cfswitch expression="#right(name,3)#">
    <cfcase value="xls">
    <cfset imagesrc="/Images/excel.gif">
    </cfcase>
    <cfcase value="pdf">
    <cfset imagesrc="/Images/pdf.gif">
    </cfcase>
    <cfcase value="doc">
    <cfset imagesrc="/Images/word.gif">
    </cfcase>
    <cfcase value="ppt">
    <cfset imagesrc="/Images/powerpoint.gif">
    </cfcase>
    <cfdefaultcase>
    <cfset imagesrc="/Images/unknown.gif">
    </cfdefaultcase>
    </cfswitch>
    <div align="center"><img src="#imagesrc#" width="31"
    height="27"></div>
    </td>
    </tr>
    <cfelseif type eq 'Dir'>
    <cfif ((name neq "." ) AND (name neq "..")) >
    <cfset tempname = #url.module# & "" & #name#>
    <tr bordercolor="##D5EBFF" bgcolor="##D5EBFF">
    <td bordercolor="##D5EBFF" bgcolor="##F4FAFF"
    class="links"><a
    href="#CGI.SCRIPT_NAME#?module=#URLEncodedformat(tempname)#">#name#</a></td>
    <td bgcolor="##FFFFFF"
    class="links">Directory</td>
    </tr>
    </cfif>
    </cfif>
    </cfoutput>
    <cfelse><!--- <cfif #dirlist.recordcount# lt
    2> --->
    <tr bordercolor="#D5EBFF" bgcolor="#D5EBFF">
    <td bordercolor="#D5EBFF" bgcolor="#F4FAFF"
    class="links">
    <span class="style6">No Files
    Found</a></span></td>
    <td bgcolor="#FFFFFF"> </td>
    </tr>
    </cfif>
    </table>
    </cfif>
    <table width="100%" border="0" cellpadding="0"
    cellspacing="0" class="links">
    <tr>
    <td height="50" align="center" valign="middle"
    class="links">
    <cfinclude template="../navmenu.cfm">
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    Thanks for your help.

    You are not able to do this with CF directly.  It would be a function of the web server.
    You could move all documents other than .cfm into a folder outside of the web root, then use tags such as cfcontent to deliver those files programatically (as often happens when you download software off of a website now days).  However I suspect this isn't what you are looking for.  Just in case here is a quick example of how you may do the force download of document from outside root:  http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/force-file-download-27

  • Make rename by parent folder script recursive

    I've found this AppleScript in the Forum and it does exactly what I need, except it is not recursive:
    tell application "Finder"
              set the_folder to name of window 1
              repeat with this_file in (get files of entire contents of target of window 1)
      --repeat with this_file in (get files of window 1)
                        set the_start to offset of "_" in ((name of this_file) as string)
                        set the_stop to count (name of this_file as string)
                        set name of this_file to (the_folder & (items the_start thru the_stop of (name of this_file as string)))
              end repeat
    end tell
    tell application "Finder"
              repeat with this_file in (get files of entire contents of target of window 1)
                        set the_folder to (name of parent of this_file as string)
                        set the_start to offset of "_" in ((name of this_file) as string)
                        set the_stop to count (name of this_file as string)
                        set name of this_file to (the_folder & (items the_start thru the_stop of (name of this_file as string)))
              end repeat
    end tell
    Instead of passing window 1, I would like to apply the script to each sub folder of a given folder, but I have no idea of how to achieve that. Any help?

    You should check out MacScripter
    They have a lot of applescripts for solutions like that.
    If you can't find a solution with Applescript, you should try Automator.
    The below will do what you want. If you just save this workflow as a Service, all you have to do is right-click it and click the service and it will rename all the files by added the Parent Folder name in front of the file names.
    Good luck.

  • How can I create a simple app that will automatically add folder script

    Hi! I hope I can get a little help on this.  I tried searching online and haven't found anything.
    Is there away I can make a simple "application" that will automatically add a folder script to a users folder?
    Basically I need a folder script to run but I don't want to explaint o a user how they'd have to do it in automator.
    I'd like to be able to create an application they double click.  The app tells them to select a folder then automatically runs the script.
    Does anyone have any ideas of how'd I'd do this?

    Oh I get it. Yeah I read you post on one of the other pages and didn't quite understand, but not that you say that your're makeing this for another user, it makes sence.
    So what you want to do is have the computer automatically install a script on a customer's computer, right?
    (I'm using "custumer" loosly; i.e. just another user)
    If that's what you'd like to do, then you'll probably have to write an actual program in Xcode, since I imagine automiticlly installing folder action scrips will be highly discuraged by Apple because it would cause a huge security hole in the OS. (You wouldn't want some random person sending you a folder action installer disgused as a regular app LOL.)
    But I will actually suggest the following, which I think will work great for your users:
    Make a regular Automator app, and drag it to your Dock. Now, have the user click and drag a bunch of photos to the application icon, and it will run the app automatically on those files.
    You could try a work flow like this:
    ask the user Are you sure?
    convert pictures
    save pictures to ConvertedPics folder
    pop up a confirmation message saying that everything was resized
    Hope this helps

  • Printing folder file names

    Is there any easy way I can print the file names of any particular folder so I can I have a printed record of it's contents?

    Peter,
    There are several ways you can accomplish that task.
    Check these threads for possible solutions:
    Printing Contents of Folder
    Printing Window Contents
    For additional suggestions Search Discussions with the term "print contents."
    ;~)

  • In Mail, is there a way to print the list of mail activity in a folder without actually printing each email?

    In Mail, is there a way to print the list of mail activity in a folder without actually printing each email?
    Thanks to all.

    Actually, I noticed in "More Like This" questions similar to mine.  One of the suggestions worked perfectly.
    Command Shift 4 turns the arrow into a target scope.  Use it to take a screen shot of the area you want printed.  Thanks to all.

  • Executing a bunch of .SQL scripts in a folder  ???

    hi ,
    I have 60+ sql scripts in a folder X..Is there any way to execute these scripts in one go..??
    I am searching for a shortcut to execute these scripts using SQL PLUS Scripting (any possible way) ..
    Can anyone give some light to solve my issue??
    Regards,
    john

    jpy wrote:
    hi ,
    I have 60+ sql scripts in a folder X..Is there any way to execute these scripts in one go..??
    I am searching for a shortcut to execute these scripts using SQL PLUS Scripting (any possible way) ..
    Can anyone give some light to solve my issue??
    Regards,
    johnls -1 *sql > combined.sql
    edit combined.sql and add "@" as first character of every lines
    sqlplus scott/tiger @combined.sql

  • Missing Folder in "PeopleTools Portal Structure & Content"

    Greeting,
    Previously
    i have imported a project(created by other developers) and build it, it will automatically exist in fronted.
    But this time i have no luck, i do the same step in another enviroment and it's not exist in frontend, i try to goto
    "PeopleTools > Portal > Structure & Content"
    i realized that my folder for the project is not there, so i try to create it
    But soon i realize that i cant create the folder (error: not unique name)
    It seems like my folder is already exist but just not show in
    "PeopleTools > Portal > Structure & Content"
    What step should i take to bring out my folder?
    Thanks

    If you create a folder, then migrate that folder as part of a project, then it might not show up in Structure and Content in the target system. If that happens, usually deleting app server cache, or waiting 24 hours will clear it up.
    I avoid this problem by migrating the parent folder even if it hasn't changed. By migrating the parent folder, PeopleTools will invalidate the cache for the parent folder that exists in the target, causing it to reload all child folders and content references. This trick works every time.

  • Error creating folder /scripts and /css with 'upload to ftp host'

    We have had a website designed for us, although I personally would like to update the website as and when needed.
    During the upload to the ftp host at 82% an error message appears regarding the creation of folder /scripts and after pressing resume, another reading /css.
    Once finished the live site is a complete mess. If someone can help expalin simply what is going on and how i can fix this problem.
    Thanks
    Ben

    Refer to a similar thread here with a possible solution to the problem.
    http://forums.adobe.com/message/5082790
    Thanks,
    Vinayak

  • How do I restore the "printing" folder in iPhoto?

    When I started iPhoto I was a little quick with the delete key when trying to clean up the left side of my screen. I errantly deleted the "printing" folder (under Recent)and wish to have it back. I can only see what I'm printing in the print queue, but that's sometimes not enough information. I'd like to see what pictures I am currently printing but not able to add the function.
    Any ideas short of a reinstall? (which if called for, please advise on that too!)
    please know that I am not missing any photos nor did I delete any other key part of iPhoto.
    thanks!

    I have my downloads folder disappear from my macbook pro.. How do I get it back . it seemed to have happened when I was installing digital edions from adobe to read filesand transfer files  for my Kobo reader. Is there anyway to get it back as a folder ?

  • [AS][CS5] Multiple action folder scripts only 1 Indesign app

    Hi,
    With this post, I would like to ask a question.
    If you use multiple action folder scripts that processes multiple files using only 1 Indesign application, can problems occure when multiple files are submitted at the same time?
    How does applescript/indesign handles multiple use of the same application? Will an error be trown? Or do I have to build a check mechanisme to know if the app is "in use"?
    Has the Indesign application a property "busy" or "In use"?
    Kind regards
    John

    Hi Mark,
    Thanks for your feedback.
    If build a lock/unlock mechanisme in my folder action script to prevent simultaneous use of Indesign. In my script I write the current application state into a textfile.
    John

  • Why does printer not show in Printer Folder after installation?

         Printer is the original OJ 6500 E709n operating with Windows 7 64-bit.
         Printer had been working well wireless, but began to not work with wireless.
         Reinstalled driver software, and everything installs OK without error.  Printer test page prints OK.
         Installation software says that installation was successful, and I click FINISH to end.
         But there is no OJ6500 icon in the Printer folder.  There used to be one.
         When I install for use with USB, a printer icon appears like normal.
         What needs to be done to be able to use this printer wireless?
    Thanks!

    Hello apx_31088.
    After installing the printer driver, please install this patch.
    Cheers!
    Wixma.
    I am an HP employee.
    Say thanks by clicking the Kudos star in the post.
    If my reply resolved your problem, please mark it as as Accepted Solution so that it can be found easier by other people.

  • Browser crash when printing flash content

    I am posting this here because I scoured the web looking for an answer and did not find one.
    OS: 10.4.11
    Browser: Safari 4.1.2, Firefox 3.6.11
    Problem:
    Any time I try to print flash content, for example, games or printables from PBSkids.com, my browser would go to the spinning beach ball and crash. Issue affected Safari and Firefox.
    Latest version of Flash was installed 10.1.x
    Fix: Downgraded to Flash 9. Problem solved am once again able to print flash content such as the examples above.

    HI Ernest,
    If Safari is crashing, post a crash report so we can try and help.
    If Safari has just crashed, press the Report button on the CrashReporter dialog box to view the crash information.
    Now copy/paste the entire contents of the Crash Reporter window into your reply here. If the crash report dialog does not appear or the crash is hard to reproduce, crash logs can be retrieved from the ~/Library/Logs/CrashReporter> folder.
    Carolyn

Maybe you are looking for

  • Vendor Text must be copied into PO texts.

    Hi Experts I assume that both "Purchasing Memo" and "Purchase Order Text" should be copied from the vendor master. When testing, only the "Purchase Order Text" is getting copied into the Purchase order. However i want the purchasing memo to also appe

  • Can I export solid objects into Illustrator / InDesign CS2 and maintain vector format

    Can Adobe 3D export solid objects in vector format into Illustrator or InDesign CS2 suite? I'm interested in taking solid 3D objects developed in Pro/E 2.0 and import from Adobe 3D into Adobe Illustrator & InDesign in vector format for page layout. I

  • ALV hotspot new window problem

    Hi all,    I have an problem. in alv list, there is a field with hotspot, after I click it, it should popup a new window with some text. But now I can't popup a new window. Look at some of my codes: FORM user_command USING p_ucomm    LIKE sy-ucomm   

  • Project templates for FrameMaker to RH mappings

    Hello, I just noticed a sample script installed with Robohelp called Project Template Generator (Project Template Generator.jsx). Does anyone know what this script does exactly and how I would import it into another project? I would like to have a wa

  • Apple mail search doesn't show messages

    I can normally search for sent and received emails by entering a persons email address in the search field with the spyglass icon, since last week I haven't been able to do this even though all messages show up in the inbox and sent folders. Is there