"File file path:to:file is already open" how do i close it?

I am trying to write a script that pops up a dialog box, asks for text and saves this to a .csv and a .txt This is so i can quickly record what i am doing and the times i am doing it, makes quick notes and various things like that. However it is failing with the message "File file path:to:file is already open" so how do i close the file or get around this. Cheers
Script Below
tell me to activate
display dialog "Enter the log message:" default answer "" buttons {"Cancel", "Ok"} default button "Ok"
copy the result as list to {the log_message, the button_pressed}
if the button_pressed is not "Cancel" then
set curTime to (do shell script "date \"+%H:%M:%S\"")
set curDate to (do shell script "date \"+%Y%m%d\"")
set new_foldername to curDate
set this_folder to (path to current user folder) as text
set fPath2 to this_folder & "Documents:Logs:Date:" as alias
--set this_folder to "Macintosh HD:Users:username:" as alias
tell application "Finder"
if not (exists folder new_foldername of fPath2) then
make new folder at fPath2 with properties {name:new_foldername}
end if
end tell
set fPath to (path to current user folder as Unicode text) & "Documents:Logs:Date:" & curDate & ":"
set fName to curDate & ".csv"
set myFile to open for access file ((fPath as string) & fName) with write permission
write curTime & "," & log_message & return to myFile starting at eof
close access myFile
set fName2 to curDate & ".txt"
set myFile to open for access file ((fPath as string) & fName2) with write permission
write curTime & " " & log_message & return to myFile starting at eof
close access myFile
end if

Hi Richard,
Run this in the script editor:
set f to choose file
close access f
Navigate to the file you left open. Probably there was an error and the file was left open because it never reached the 'close access' command.
gl,

Similar Messages

  • How do I attach a file to an email which is already open on the iphone5?

    How do I attach a file to an email which is already open on the iphone5?  ie I have already opened an email and started typing it.  How do I simply attach a photo to the email?

    Go to the Photos App, select a photo and then select Copy from the Share icon (box with arrow).
    Return to Mail and paste the photo where you want it.

  • I can't use my skype's cam because FaceTime'cam is open.how can I close FaceTime?

    I can't use my skype's cam because a FaceTime's cam is still open. how can I close it?

    Quit FaceTime.

  • Scanner automatic doucment feeder cover is open, how do i close it?

    My HP Officejet 4630 scanner automatic doument feeder cover is open , how do I close it?

    Hi Ettaus123,
    Thank you for visiting the HP Support Forums! I see the Automatic Document Feeder (ADF) on your HP Officejet 4630 and will not close.
    I would like you to click on the link below, and check out the diagrams in Step 2: Clear any jammed paper from the ADF. The steps listed will show you how to close the ADF cover.
    An 'ADF Jam: The original has jammed in the automatic document feeder (ADF)' Message Displays on the..., please disregard the title of the troubleshooting document, I am sending it as the pictures are very helpful.
    I hope this helps.
    HevnLgh
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • FORMS 6i. How get file's path from file's name?????? HELP

    I want path of file IExplore.exe on file system...
    Thanks

    Hi!
    U can search for the path of the IExplore.exe and use it as
    Declare
         AppID          PLS_INTEGER;
         v_application VARCHAR2(300);
    Begin     
         v_application:='I:\Appli\Gbps\Help\iexplore.exe D:\XYZ\Help.htm';
         AppID := DDE.App_Begin(v_application, DDE.APP_MODE_MAXIMIZED);
         DDE.APP_END(AppID);
    End;
    D:\XYZ\Help.htm specifies the default file to be opened.
    If u don't give the html file name, it will just open Internet Explorer.
    Or else u can also use the Host command.

  • When two screens are open, how do I close only one screen?

    When the site opens screen A sometimes has user open screen B. When user finishes screen B and desires to return to screen A, the x in the upper right corner is chosen, a message appears you are about to close 2 screens however user only wants screen B to close. I cannot find a way to close only screen B. How do I close only screen B?

    Hi:
    When you talk about ''screen A and screen B'', are you referring to tabs on the top of your screen in Firefox? Because to close those, you:
    # click on the tab
    # while in the tab, go to the top of it at the top of your screen
    # hover over it
    # you shoould now see an "x" at the rightmost side of the tab. Now click on that to only close that tab.
    Were you referring to that? Thanks for your patience!

  • HT201365 Once an app is opened, how do I close it? Before I would double click and pressed on the app icon and I could then close it.

    I went through the up date for my iPad. How do I close an opened app? Before I would double click and the opened app would appear at the bottom of the screen. By pressing on  that app, a negative sign would appear and by touching it the opened app would close. I tried this with the up dated version and it doen't work. What next?

    Double tap the home button and swipe upwards on the preview of the App (not the App Icon).
    http://manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf

  • How can I insert a file in email When email is already open

    When my email is open I would like to insert a file or attachment

    You can insert a photo but inserting a different type of document requires you have Acess to the app that contains the document.
    If you are already preparing an email select everything in it and choose Copy. Then close the email and open the app that contains the document you want to share. Select the document, select Share and choose Mail. Once the Mail app come up with the document attached paste the stuff you copied from your draft.

  • Changed file directory path on new drive...how do I import my music and playlist?

    Previously I had relocated my iTunes library successfully to an internal secondary drive on my old PC.  Years later, my PC crashed and i had to reinstall everything, also upgraded from xp to Win7.  Due to preference' storage, I installed iTunes (v11) onto my c drive, but want my iTunes library on my secondary d drive. Should mention that I was able to saved all my iTunes music and apps from the crash.  So I installed iTunes on c drive.  Obligatory iTunes media file was installed by program default into my music, of which I deleted.  I opened iTunes and set media file path in advanced setting to d:\itunes, which is the folder that I have prior sub folders for music, apps, TV, movies, etc with xls and itl file as was previous before crash.  Closed and reopened iTunes. Did not recognize library.  So then I moved xls and itl file out of the folder to desktop, closed and reopened.  Recognized some music, and wanted me to download from the cloud music that was physically in the folder.  No apps recognized. Wanted me to turn on home sharing, which I don't think will work in my case as I have no oither computers running itunes .  as there was no option to import a library in v11, I deleted this version.  Next, I installed version 9 from apple support site.  Again deleted iTunes media folder (empty) set by default in my music on c drive.  Set file path in. ITunes advanced tab to d:\itunes as previous, where library is now located.  Then imported xls file in iTunes folder on d drive through library tab.  This worked to a point.   All music in iTunes music folder and playlists were now showing in iTunes.  Apps are not.  Yes, have app tab checked.  Also, when xls file was imported, new iTunes media file folder was recreated in my music on c drive, and duplicate copies of all music files imported from original music folder on d drive were created within the iTunes folder on d drive.  Clarification: my library is set up on d drujve as such: have a main iTunes folder, then sepereate subfloders for TV, music, apps, books, etc., versus having a iTunes media folder containing all these separate subfolders.  So you can imagine, had original music files in music folder, and then had duplicate music files created in the original iTunes folder intermixed with music, app, books sub folders as a result of this step.  Also tried placing music, books, app folders into a media sub folder, with no change.  Never even got to step of syncing ipad.  Just trying to re establish previously working library.  Sorry so long a message.  Stumped.  Help!

    Copy the entire iTunes folder from the old computer to the new computer.

  • On every URL link in Microsoft Outlook I get the message that "The system cannot find the file specified." Then it proceeds to open it AFTER I close the error message. I just updated Firefox a few days ago and it began then and continues.

    It shouldn't take any more detail than this. This is what happens every time:
    "Generald failure: The URL was 'http: //link.washingtonpost.com/r.....' The file system cannot find the file specified."
    '''EVERY URL'''

    See:
    * http://kb.mozillazine.org/Windows_error_opening_Internet_shortcut_or_local_HTML_file_-_Firefox

  • TS3274 I have multiple safari windows open, how do I close them 1 at a time?

    Does anyone no how to accomplish closing safarie window 1 at a time or even all at once?

    If you have iOS 5+ with the tabbed browsing then you can close the 'active' tab by tapping the 'x' on the left of the tab (you can't close the last tab).
    If you have iOS 4 or below then tap the icon of the two squares to open the thumbnail/page view and you can close them from there

  • Error message "The document could not be saved. This file is already open" when trying to complete an electronic signature.

    Running Adobe Acrobat Professional 10.1.0. I cannot upgrade to newer version because several applications were already tested on this version.
    When trying to complete an electronic signature, my users receive the error message ""The document could not be saved. This file is already open".  When they close and open the file again to try to sign again they find a corrupted electronic signature.  Instead of a clean signature with the box colored in light blue they see their signature with the embedeed message Click Here to Verify & Sign with the box colored in grey.
    We turned off antivirus in the Sharefolder where the forms are stored and nothing.  We turned off the antivirus on the client and nothing.  We stored the files in another server and nothing.  One workaround is saving the file in the desktop, signing it, and then back to the Sharefolder.  Another is saving the file with a different file name.
    I've searched and the only similar thing was caused by the Windows Preview Pane.  See Information Transmogrification: Adobe Acrobat saving a file does not work, displays “File may be read-only”.  No luck with this one too.
    Is definitively an intermittent problem.  The users that experience the problem experience it intermittently.
    This started to happen when we move our computers to Windows 7.
    Any ideas?

    Correction on Question:
    This is a web application and the users need to be able to load the editable .pdf form from the website, edit it and submit it back to the website from within Internet Explorer.
    Users began getting the error message:
    'The document could not be saved. This file is already open.'
    last Friday after having no problems prior to this. Some users can edit the editable .pdf forms on the website and save the file with the same name to the website. Some get the error mentioned in the subject. 
    We really need help getting this resolved.
    Sandy Martin

  • PS (5.5) crashes when opening PS file, unless it's already open

    Photoshop crashes every time I attempt to open a photoshop file. If the program is already open, it wont crash, but if I double click on a photoshop file to open it, it opens in photoshop, and then immediately the message "Adobe Photoshop CS5.1 has stopped working" and "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." with the button option [Close program].preven
    This problem isn't preventing me from finishing my work, but it is kind of weird. I have to open photoshop and then drag my photoshop files in, or else it crashes. Anyone else had the same problem before?

    Several things external to Photoshop can cause crashes on open:
    Buggy display drivers.
    Poorly written 3rd party plug-ins (or those mismatched to your version of Photoshop).
    Corrupt or badly formed fonts.
    Bad default printer configuration.
    There are probably more.
    I suggest visiting the web site of the maker of your video card and downloading and installing the latest driver, then rebooting.  Under some conditions you may have to go into Edit - Preferences - Performance and disable OpenGL Drawing (by unchecking the box).  Remember to close and reopen Photoshop after any settings change before testing.
    -Noel

  • Drag and Drop an Attached AutoCad File in a PDF Portfolio to and Open Drawing in AutoCad

    I currently Printed all my Details to PDF and combined them all into a catalog to view them. I them attached all the AutoCad files to the PDF. I can open the AutoCad file in the pdf, but it will open it as a new drawing int AutoCad. I would like to Drag and drop from the PDF file to a drawing that is already opened in AutoCad. Any suggestions?
    Thanks

    Hello,
    I think you posted this question in the wrong forum: this is one of the Captivate forums and I do not see a relation to it, but can be wrong.
    Lilybiri

  • .prproj file extension missing in file association preferences Bridge

    I recently updated Bridge and lost my ability to open Premiere Pro projects from Bridge.  The prproj file would open in Media Encoder instead. I could however open the prproj file in Windows Explorer. The following is the fix to add prproj to file association option to Bridge.
    The Steps
    Navigate to C:\Program Files\Adobe\Adobe Bridge CC (64 Bit)\Resources\Adobe Bridge Opener Preferences.xml
    Right Click on the file named Adobe Bride Open Preferences.xml , select "edit" from the fly out menu. The file will open in "Notepad"
    Expand the Notepad window, scroll to the bottom. Before the statement </openers> copy and paste the following statement.
    app_name="Premiere Pro">  
        <item description="$$$/Bridge/OpenersXML/Description/PremiereProject=Premiere Pro" extensions="prproj" app_name="OS">
         4. Now save the file to the desktop as Adobe Bridge Opener Preferences.xml and close.
         5. Navigate to C:\Program Files\Adobe\Adobe Bridge CC (64 Bit)\Resources
         6. Drag the file you saved to the the Bridge Resources folder.
         7. When prompted click "Move and Replace"
         8. Open Bridge and go to Edit> Preferences> File Type Associations
         9. Scroll to the bottom and you will see Premiere ( if you do not you may need to restore to default)
         10. Now you can add the correct File Association to the .prproj file.
    I am not sure if this is an isolated problem, but I thought that this information could help someone out there.

    thanks again... when you look at the directory tree in bridge i see...
    all of the folder and files where of jpeg and i could open and edit 
    here but they would not be edited in iphoto... once i updated to 
    ilife09 they became this...
    also if I go in thru the harddrive to get a picturefrom the pictures 
    folder that you see at the top it sends me here... i now have to 
    access the photo library by the way of the finder to the pictures 
    folder... any thoughts as to how to clean this up and would deleting 
    bridge help remove?
    russLAZAR
    [email protected]
    714-505-5441
    russLAZAR
    [email protected]
    714-505-5441

Maybe you are looking for

  • I cant download JT's albums through my purchased list

    Hello. I was listening to music through my iphone today, and decided to look for Justin Timberlake's first part of the 20/20 experience album in my music app because I wanted to listen to it again. Only, when I searched, it did not come up on my list

  • STO Issue,Intra company

    Hi, We have created one document for plant to plant STO within same company code.Here we have two separate profit center for two plant.When I will do PGI inventory account entry is generated  and value is moving from one profit center to another but

  • Subreports always start in a new page

    Hi, I have 4 subreports in 1 page, based on the suggestions from this forum, I put them into 4 different GroupHeaderSections so all the data is displayed. The problem I have now is that if a subreport is too big, it will start a new page and leave a

  • Help with data services to run a job

    Hi, I have a xcelsius file (swf) that run a job using webservices from data services, and verything works good, the problem is when i publish the file in thw web server IIS, the webservice dont start the job. There is some configuration of IIS that c

  • Excel Upload in Publisher

    Hi Experts, Is it possible for me to upload an excel through publisher. I have seen the option of Upload report in publisher.I can upload only .xdo and .zip files. I waant to know wht is this .xdo file. Can i modify this file to upload an excel. Appr