Call AppleScript on file change ?

Hi,
is it possible somehow to start AppleScript when content of file change? (using FolderAction or whatever??)
I'm using textedit (Coda) for HTML and PHP coding and I want to Safari reload page every time when I save file (hit Command+S).
Q: is it possible to triger AppleScript when I save from some App or to detect that content of file is changed (due saving file from App)?
Thank you in advance!
Message was edited by: milankovach

'Is it possible somehow to start AppleScript when content of file change?' - no.
'using FolderAction ...' - no.
'... or whatever??' - depending on 'whatever', most likely - not.
'Q: is it possible to triger AppleScript when I save from some App or to detect that content of file is changed (due saving file from App)?' - no.
Possible solutions:
01. You can create an AppleScript applet (application) which constantly checks a known files' 'modification date', and act accordingly.
02. You could use an utility application such as 'Butler' and via its 'Smart Item, AppleScript, AppleScript'' feature - assign a keyboard equivalent for 'TextEdit', 'Coda', or another editor application to save the contents of the applications' frontmost document, and then tell 'Safari' to open (and thus - reload) a respective web page.
For example:
Within 'Butler' a 'Smart Item, AppleScript, AppleScript' was created, and assigned '<control> <shift> c'.
The associated starter Source Code is ...
-- Code starts here --
set tFile to (((path to desktop folder from user domain) as string) & "index.html")
tell application "TextEdit"
activate
save document 1
end tell
tell application "Safari"
activate
open (tFile as alias)
end tell
-- Code ends here --
Make sure to set 'Bulter's 'Triggers' tabs' 'Hot Key' 'Exceptions' popup button menu to 'Only'; add 'TextEdit', and / or what text editor(s) you use, to the textedit field beneath the just mentioned popup button; and actually assign a 'Hot Key' value - such as '<control> <shift> c'.
The code is brief, crude, and works.
You will have to refine the code so ...
set tFile to (((path to desktop folder from user domain) as string) & "index.html")
... can be removed, and whatever document is the front most of 'TextEdit', 'Coda', etc. is saved, and then opened by 'Safari'.

Similar Messages

  • How to Trace the file changed in the IVR for an IPCC call flow.

    We  have an issue where :
    Customer reported for one process out of office message was wrong.
    We have uploaded the new message file and it started working fine.
    We require help to check if any log to proof that the same process “Out Of Office” hour message file changed from our end
    Urgent !! Please advice.

    Hi
    If you are on IPIVR or UCCX, then you can see in the MADM logs who has carried out what changes (c:\program files\wfavvid\logs\madm).
    If you have users dialing in through an application to change prompts, or through some other custom method, you should really be logging changes as they are made...
    Aaron
    Please rate helpful posts..

  • Why do I get error -17500 when calling a batch file using the call executable step type?

    I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
    sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?

    It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
    wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.

  • File change for highest level page home page

    file change for highest level page home page
    When I got these files
    I would type server/mywork/bkb
    These files are in the server under the folders mywork/bkb
    When I type server/mywork/bkb
    The my index page would show up
    That’s fine.
    Now, I created a page called highestpage.cfm
    The purpose is for me to put the link myindex.cfm and it
    works fine.
    But my problem that I am really still confused is
    It will show up when I type server/mywork/bkb/ myindex.cfm
    But my goal is not to type that far off.
    I just want to type I type server/mywork/bkb/ without
    myindex.cfm
    And still will lead me to I type server/mywork/bkb/
    myindex.cfm
    Just like the earlier version
    server/mywork/bkb that lead me to myindex.cfm
    but only now will lead me to highestpage.cfm
    I hope I am expressing my self correctly.
    Thanks for understanding

    If I understand your situation correctly, you can accomplish
    this by setting the default web page names in your web server,
    whatever that might be - Apache, IIS, etc. The web server will have
    some default file names (web pages) that it will serve if no
    specific file is requested. this is often index.html, index.cfm,
    etc. You want to add myindex.cfm to that list.

  • How can we call a jar files(seperate projects jars) to each link of the tre

    how can we call a jar OR WAR files(seperate projects jars OR War) to each link of the tree.

    i want have home page that have this menu
    ========================
    -- Sale
    --- Customer
    --- Reader
    -- Energy
    --- Calc
    -- Service
    --- Chnage Name
    --- Change Code
    =======================
    For example
    --- Change Name
    ---- Page Reister
    ---- Page Confirm
    ---- Page Anoc
    ---- Page Save
    ======================
    i want user to access to every page From Each Case(Change Name) .
    i create for change name one project in my fushion web app and for other case
    How to I Can Call Page register From change name in Menu of The home page ????
    Edited by: user13151366 on Feb 4, 2013 4:44 AM

  • How to call a .js file from a JSP in JSPDynpage

    Hi ........I have a javascript file called set.js under the scripts folder .
    I need to call this .js file from my JSP in a JSPDynpage Application.
    Please help me do this..
    Regards
    Smita

    Hi,
    store your js file also under the jsp folder with a .jsp extension and then call it in your jsp page by an include statement. this was found working. later you may try with changing the extension to .js and try your luck:)
    <%@ include file="set.jsp" %>
    Chill,
    Steel

  • Event handling to listen directory file changes?

    I want to write a Java program that watches directories for changes. If there are any new files, or files are deleted in a directory, notify the user. I think this is a multi-thread program that watches files changes in specific directories. But I don't know what listener that the program should implements. please help!!

    There are no events that do what you ask (actually, there are native OS events in Win32 that do this, but I suspect that isn't what you are going for).
    You'll need to write your own event source for this (and hey, if you are feeling crazy, you could even create your own event type - FolderChangedEvent or such).
    Start a thread that wakes up periodically and checks the contents of a specified folder for changes. If there is a change, fire your event to any listeners.
    Now, how you actually define a change in a folder is an entirely different matter. It may be sufficient to calculate a CRC (or Adler32) on the modified date of all files in the folder, then compare that to a previous version to see if there has been a change.
    If you have to drop into sub-folders, you'll need to create a recursive call to do that.
    - K

  • Call forwarding - after the change of the phone nu...

    Hello!
    I have an subscription, which inludes Call forwarding . After changing the phone number, my Skype credit began to decrease. What is the reason and which solution could be found in this case? Looking for an answer.

    Hua Min wrote:
    D:\oraclexe\app\oracle\product\10.2.0\server\BIN>LSnrctl status
    連線至 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    TNS-12541: TNS:沒有監聽器
    TNS-12560: TNS:協定介面程式錯誤
    TNS-00511: 沒有監聽器
    32-bit Windows Error: 2: No such file or directory
    連線至 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.104)(PORT=1521)))
    TNS-12541: TNS:沒有監聽器
    TNS-12560: TNS:協定介面程式錯誤
    TNS-00511: 沒有監聽器
    32-bit Windows Error: 61: Unknown error
    D:\oraclexe\app\oracle\product\10.2.0\server\BIN>LSnrctl service
    連線至 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    TNS-12541: TNS:沒有監聽器
    TNS-12560: TNS:協定介面程式錯誤
    TNS-00511: 沒有監聽器
    32-bit Windows Error: 2: No such file or directory
    連線至 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.104)(PORT=1521)))
    TNS-12541: TNS:沒有監聽器
    TNS-12560: TNS:協定介面程式錯誤
    TNS-00511: 沒有監聽器
    32-bit Windows Error: 61: Unknown error
    Thanks & Best Regards,
    HuaMinYou have OS related errors; external to Oracle.
    Are both OS Services for Database & Listener running?

  • Trying to login to software program known as hamspher (vip simulated ham radio,  it downloaded the program but it will not allow me to login with call sign and pin.  it has to be opened with what they call a jar file.  how do i do this?

    trying to login to software program known as hamspher (vip simulated ham radio,  it downloaded the program but it will not allow me to login with call sign and pin.  it has to be opened with what they call a jar file.  how do i do this?

    This is compatible with Mac? Especially Snow Leopard (if that is what you'e running)?
    Have you considered posting your question in their forums?
    Here is some information re. the jar file:
    http://ostermiller.org/opening_jar_files.html

  • Weblogic call a excel-file from URL doesn't open MSExcel but flat html

    Weblogic call a excel-file from URL doesn't open MSExcel but flat html
    Hi,
    WLS 10.3.5
    Forms 11.1.1.4
    I do migrate from AS10g to WLS 10.3.5 / Forms 11
    I get differences between FORMS 10 g / AS and FORMS 11 / WLS
    when call an excel-file with web.showdocument
    in 10g AS10g
    the call
    web.showdocumen('http://MyAS10_Server/myFormsMapping/myExcelfile.xls, _blank);
    opens a Windows-Box
    to decide
    open with ( MSExcel )
    or
    download and save as File
    in WLS 10.3.5 / FORMS 11.1.1.4
    the call with webcache Port 8090 as well as Port OHS 8888
    web.showdocumen('http://MyWLS_Server:8090/myFormsMapping/myExcelfile.xls, _blank);
    opens promptly the excel-File into the Browser as html-Format
    How to get the same way under WLS as before in AS 10g,
    config OHS ?
    regards
    get answer here :
    Weblogic: when call a excelfile from URL doesn't open MSExcel but flat html
    Edited by: astramare on Sep 12, 2011 11:59 AM

    Weblogic: when call a excelfile from URL doesn't open MSExcel but flat html

  • How to call a class file in a jsp without deploying anything in j2ee

    Hi,
    I am new in J2EE. I have some jsps, which I configured using web.properties(documentroot=c:/jsp/). I am able to get
    those pages by the web browser. I have some import statements in some jsps, now I
    am trying to access those page but it is failing, it says
    org.apache.jasper.JasperException: Unable to compile class for
    JSPD:\j2sdkee1.3\repository\pradip\web\_0002fLogin_0002ejspLogin_jsp_0.java:1:
    Class com.gui.UPMGuiGlobalConstants not found in import.
    import com.gui.UPMGuiGlobalConstants;
    Actually I have not deployed any class file or jsps.. Now my question is can I access
    these jsps without deploying anything, like can I put my .jar file in any j2ee
    directory(like lib or anywhere else, I already tried after putting in /lib) and restart the
    j2ee and use it. So how can I call a class file from a jsp without any kind of
    deployment?
    Please send me the reply as soon as possible.
    Regds,
    Pradip

    After you put the jar containing the class to import into the WEB-INF/lib directory, you still need to include it in the jsp.
    Putting the jar into the lib dir, will make it available to the vm, but as in any other java class, you still need to import it into the class, that the jsp will be compiled into.
    And you do that by putting
    <%@page import="com.gui.UPMGuiGlobalConstants" %>somewhere near the top of your jsp. (well you don't need to put it there, but it good style ;)
    That should do it.

  • How to call a jar file from oracle forms (6i)

    Hi,
    I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
    thanks.
    duminda

    I created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
    then i tried to run it in application server. its still not running.
    can you tell me what i have to do within my bean class? or can you suggest any solution?
    thank you.

  • How to call a .jsp file from Applet

    Could any one guide me how to call a .jsp file from a Applet using action Event.
    Thanks

    http://javaalmanac.com/cgi-bin/search/find.pl?words=URL+post

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

Maybe you are looking for

  • Hyperlink-trouble after upgrade to CF 7

    Hello I am currently editing an old CF site where the host have gone from CF 5 to CF 7 (without warning =). All hyperlinks with a CF attribute have stopped working for some reason, let me clarify: from an SQL like this: (code is rewritten ) <cfquery

  • Shuffle within a Playlist?

    So when you set the control to shuffle, will it shuffle within the playlist selected, or just shuffle everything on the unit like the old shuffles do? As soon as someone gets one, or if an Apple moderator is monitoring this, let us know. Thanks

  • How to avoid primary key insert error and pipe those would-be error rows to a separate table?

    Hi All, Question: How can I ID duplicate values in a particular column before generating a "Violation of PRIMARY KEY constraint" error? Background: this SSIS package pulls rows from a remote server table for an insert to a local table.  The local tab

  • Workflow service issue

    Hellos, I assign a value for the field "Identification Key" which is inside the task Object, in scenarios where i set a value more than 100 Character, i get the following error: java.sql.SQLException: ORA-20003: Error while inserting task ORA-06512:

  • TuneupInst-3.0.7.0.exe fails to download any standalone link to download it?

    I have an older Ipod and my iTunes is updated.. but every time I open the software, it asks to update this program but fails. I'm a Windows 7 and 3rd gen ipod. I tried turning off my firewall and any antivirus programs.