Edit/update config file with Applescript??

am trying to read the file and then trying to change the values of the same with permissions, pls suggest how to write the same file with permissions.
The below script gives me the values as shown below, i need to change those values like aaaaa to 1, pls suggest.
set fileContents to {}
set x to ""
set filepath to POSIX path of "Macintosh HD:Library:Application Support:Macromedia:abc.cfg"
try
    open for access filepath
    set fileContents to (read filepath)
    close access the filepath
on error
    return false
end try
fileContents
output :
"aaaaa=0
bbbbbbb=0

If you want to write to the file you need to open it with write permissions
open for access filepath with write permission
Ideally you should store the result of that command as a reference to the opened file:
set myFile to open for access filepath with write permission
now you can read the data:
set fileData to read myFile
You can erase the file by setting the EOF to 0:
set eof myFile to 0
(otherwise writing to the file appends data, rather thatn overwriting it)
You can write data to the file:
write "blah blah blah" to myFile
and close it when you're done:
close access myFile

Similar Messages

  • Is it possible to diable the automatic update feature and prevent it being re-enabled from the preferences dialog by editing a config file?

    Id like to do a custom version of FF for our machines (Linux based) which prevents the auto update mechanism working and prevents the user re-enabling it. Any updates would be done by the Linux .deb package management system.
    Is there a way to do with by editing the config files of the default binary version or do I need to build my own from source?

    You can lock the related pref(s).
    lockPref("app.update.auto", false);
    lockPref("app.update.enabled", false);
    See:
    * http://kb.mozillazine.org/Locking_preferences

  • How do i edit a pdf file with acrobat 9 standard

    i have a doc that was sent to me thru email, i saved it as a pdf file now i want to edit it and it seems impossible. Please help!
    Thank you

    First choice is to edit the source file with its 'host' application.
    Acrobat provides the TouchUp Text tool for *minor* touchups.
    But, regardless of this PDF is not an editing / layout / formatting format.
    Be well...

  • How do I edit a PDF file with Adobe PDF Pack?

    How do I edit a PDF file with Adobe PDF Pack?

    Well, you don't. Editing a PDF is a difficult and fraught business even with the most expensive software.
    But PDF Pack lets you export to Word; then often you can edit in Word. Now you can make a new PDF. It might look like the original, or it might not. If small changes matter you might be out of luck. ON NO ACCOUNT USE THIS FOR GOVERNMENT FORMS.

  • Update jar file with modified class files

    hi all,
    I'm developing a jar utility for updating a jar file with modified class files as of now i have reached a point where in i can browse files and set it to required location
    i.e i have developed a swings GUI application using JfileChooser and browse the files ..now my requirement is to update the jar files with modified class file
    GUI looks like below
    ....enter the modified class file ----> d:\c.class
    ....enter the jar file path ---> d:\a.jar
                                                          update button now i have the requirement as
    1> when i click on the update button ,my jar file (a.jar) should get updated with the latest class file (c.class)
    can u help me to achieve this requirement.???
    im stuck with this,,,if u can provide me wit the code for updating jar file with latest class file...it will really be helpful
    if u can help me with the code on click on update button it will be really helpful
    Thanks and expecting a faster response from u all java experts....

    Please find my query in bolds...i have written the partial code now,i need some help now
    hope u guys can help me out...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    public class FileExplorer extends JDialog implements ActionListener
         JTextField txtLocation_class;
         JButton btnBrowse_class;
         JLabel label_class;
         JTextField txtLocation_jar;
         JButton btnBrowse_jar;
         JLabel label_jar;
         JButton updatebutton;
         public FileExplorer()
                   setSize(600,300);
                   //for class files
                   label_class = new JLabel("Please select Modified Class File");
                   txtLocation_class= new JTextField(20);
                   btnBrowse_class = new JButton("Browse");
                   btnBrowse_class.addActionListener(this);
                   //for jar files               
                   label_jar = new JLabel(" Please select the Jar file");
                   txtLocation_jar= new JTextField(20);
                   btnBrowse_jar = new JButton("Browse");
                   btnBrowse_jar.addActionListener(this);
                   ActionListener updateListener = new ActionListener(){
                    public void actionPerformed(ActionEvent ae){
                     if(ae.getActionCommand().equalsIgnoreCase("Update")){               
                      System.out.println("ae.getActionCommand() :: "+ae.getActionCommand());
                      System.out.println("Update Button is pressed");               
                    *//Query :how do i access FilePath and FilePath1 here which*
    *                // has been set in public void actionPerformed(ActionEvent ae)*
    *                //method below*
    *                // FilePath  ---??*
    *                // FilePath1  ---??*
    *                // how do i access the above 2 parameters*
    *                //Query :on click of update button i have to pass*
    *                //two parameters FilePath and FilePath1 to*
    *                //perform some functionality. please help me*
    *                //to achieve this..how do i access Filepath and Filepath1*
    *                //here which has been set below.*
                     } // end of if               
                   } // end of actionPerformed
                };// end of ActionListener
                  updatebutton = new JButton("Update");
                  updatebutton.addActionListener(updateListener);
                   //adding to the panel               
                   JPanel pnl = new JPanel();
                   pnl.add(label_class);
                   pnl.add(txtLocation_class);
                   pnl.add(btnBrowse_class);
                   pnl.add(label_jar);
                   pnl.add(txtLocation_jar);
                   pnl.add(btnBrowse_jar);
                  pnl.add(updatebutton);
                   getContentPane().add(pnl);                         
         public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              if(obj==btnBrowse_class)
                   final JFileChooser fcstudent = new JFileChooser();
                   int rtrnval = fcstudent.showOpenDialog(this);
                   if(rtrnval==JFileChooser.APPROVE_OPTION)
                        try
                             File file=fcstudent.getSelectedFile();                         
                             String path = file.getPath();
                             System.out.println("This is Path:"+path);
                             txtLocation_class.setText(""+path);
                             String FilePath=txtLocation_class.getText();
                             System.out.println("FilePath is ::"+FilePath);                                        
                        catch(Exception ex)               
                             ex.printStackTrace();
              }else if(obj==btnBrowse_jar){
                             final JFileChooser fcstudent = new JFileChooser();
                             int rtrnval = fcstudent.showOpenDialog(this);
                             if(rtrnval==JFileChooser.APPROVE_OPTION)
                                  try
                                       File file=fcstudent.getSelectedFile();                         
                                       String path1 = file.getPath();
                                       System.out.println("This is Path:"+path1);
                                       txtLocation_jar.setText(""+path1);
                                       String FilePath1=txtLocation_jar.getText();
                                       System.out.println("FilePath is ::"+FilePath1);                                        
                                  catch(Exception ex)               
                                       ex.printStackTrace();
         public static void main(String arg[]){
                   FileExplorer Exm= new FileExplorer();
                   Exm.setVisible(true);
    }

  • Can no longer edit app descriptor file with 3.4 - really?

    Until now, when publishing to AIR from Flash Professional, I could manually edit the app descriptor XML with a little workaround:
    1. Set up my publish settings in Flash Professional and click OK
    2. Then edit the XML file and save it
    3. Then Publish from Flash Professional WITHOUT opening the Publish Settings again (which would recreate the XML file).
    This has been CRUCIAL to me in order to add certain elements to the XML file such as <extensions> I want to include with my project.
    However, this seems impossible to do with the 3.4 AIR SDK release version. When I try, it ignores my manual edits of the XML file and simply removes them when I publish. This is a HUGE problem because now I can no longer add <extensions> in the app descriptor file (and this can't be done from the Flash Professional GUI).
    Anyone have ANY idea how to keep adding my extensions to the app descriptor file?

    Hello,
    I have the same problem, but not the same solution : I have an old air application under Air 2.0, with an automatic updater, and wanted to make an intermediate application as seen here : http://helpx.adobe.com/air/kb/update-air-2-or-earlier.html .
    So I have to change the application descriptor by hand. But Flash CS6 always overwrite this descriptor with its own datas while exporting.
    How can I change my application descriptor for this intermediate version ? I have Flash CS5, but not Flash CS5.5, and the extension for Flash CS5 doesn't exist anymore !
    Thanks !

  • How to correctly update .indd files with incopy through adobe cc

    Hello,
    We have a group of users in our company that only have incopy. This is done both for a control (no one changes layouts by accident) and for cost savings of not haveing the full suite for every user.
    With this environment we have found that...
    After any change to text via incopy, a person with adobe InDesign will need to open the file and update links so the .indd file will reflect the text changes.
    This will need to happen after proofing or any other editorial changes along the way. This adds many steps to our workflow.
    Ex:
    Alyssa is editing a sustainability article with incopy (no indesign). She makes her edits and save the contents (copy fits, remove a punctuation etc). However, when viewing the .indd file in adobe CC, her changes are not reflected.
    Bill (indesign user) had to open the file with InDesign, click update links (this is a popup box upon opening) and then save the file again, before the file would reflect the text changes.
    Does anyone know of a way to get around this? It would be great if incopy could push the text changes to the .indd file without a seperate step.
    Thank you,
    Andy

    I'm a little confused. Are the InCopy users using InCopy to edit standalone files (they're opening ICML files)? Or are they opening up the INDD file (the layout) in order to edit the stories context of the design.
    If the latter, then there's no need for the InCopy user to wait for an InDesign user to do something. As they make their edits in InCopy, the layout view in InCopy gives them a pixel-accurate preview of how their changes will appear in the final layout. If other InCopy users are editing different stories in the same publication (layout), any user can update to view their colleague's edits on a story-by-story basis, or all at once.
    And when an InCopy user sits down to work and opens a layout from the server, InCopy automatically makes sure that they are seeing the current versions of all stories in the layout ... they don't get prompted to update the stories, it happens by default. Even if the InDesign user hasn't touched the file or updated the stories.
    FWIW, most of my InCopy/InDesign clients use this layout method.
    AM

  • Using Custom Config Files with WinForms

    I have created a new .config file for my application called "MyConfigFile.config" but I do not know how to reference, read or update it. Should I treat it as any other generic XML file?
    Rob E.

    The configuration file should be in the same directory as the application. The name of the configuration file should have the same name as the application with .config at the end. For example, an application called Watcher.exe should have
    a configuration file called Watcher.exe.config.
    To access the appSettings values from inside the program, use the AppSetting property of the ConfigurationSettings class.
    string title = System.Configuration.ConfigurationSettings.AppSettings["Title"];
    Two things should be kept in mind when accessing appSettings from the configuration file.One, the AppSetting could be null. Two, the AppSetting property always returns a string.When getting values from the configuration file, the code needs
    to handle these situations.
    One way to approach this is as follows:
    int AppSetValueMax = 0;
    if (ConfigurationSettings.AppSettings[key] != null)
    try
    AppSetValueMax = Convert.ToInt32(ConfigurationSettings.AppSettings["Max"]);
    catch(Exception e)
    //Exception Handling

  • HT201210 I have done all of the things on this list, to include editing the hosts file with no the same error each time (3194).  I am trying to restore my iphone 4 ios 6 to get it unlocked.  Diagnostics show no issue communicating with apple. Help.

    I am trying to restore my iphone 4 ios 6 to acheive unlock.  hit restore and it unloads software, confirms with apple then displays the 3194 error.  I have turned off my virus scanner, unplugged all usb except for iphone, edited the hosts file and run diagnostics which showes communication with apple is fine.  What do I need to do to get my ipone to restore?

    There is nothing wrong with the OS update.
    Delete ALL your email accounts.
    Restart Playbook
    Put the accounts back and ensure they are all set with PUSH ON.  Manual (push off) will burn battery.
    Similarly delete your wifi connections and add back when required. 
    Turn off wifi is not connected to wifi. 
    Any "hunting for connection" in email or wifi will burn up battery.

  • Find a file with AppleScript

    Hi everyone !
    Is there a way to find a file using AppleScript ?
    The "find" command in the finder seems not working or I have a problem with the syntax.
    In an other hand, I dont find any way to script Spotlight...
    I hope I am wrong
    Any idea will be welcome
    JPaul

    Hi Jeanpauld,
    It works fine.
    As the final use is in a FileMaker pro data base, I
    prefer this solution.
    Glad to hear the script worked for your particular situation.
    In which dictionnary can I find SpotlightSearch ?
    "SpotlightSearch" is just what I named the subroutine of the script. You could name it whatever you like but I figured that would be a good name for it since it uses the spotlight technology to perform the search.
    As Joseph Briggs pointed out the best way to get information about the mdfind command used in the do shell script portion of the SpotlightSearch subroutine is to use the Terminal application. Launch the Terminal and type man mdfind.
    If you have any further questions regarding this command please feel free to ask and I would be glad to try and help you through it. There's quite a bit that can be done using the mdfind command!
    Thanks a lot for your help !
    Anytime Jeanpauld.
    Sorry about not replying to your response sooner but the new discussion forum format is refusing to email me letting me know when my subscriptions get updated. I used to rely on that feature and will have to keep my own eye on my subscriptions for a bit while Apple works out the bugs in the new forums.
    Take care Jeanpauld...

  • LV 8.2 Config File with Enum bug

    Please refer to attachment.
    Set the Enum and run the VI. The Enum is converted into string and then saved into a config file.
    The file is immediately read and the key is converted back to enum.
    It works fine until you choose index 32 in the enum. Either the Write Key or the Read Key fails to encode/decode enum index 32 correctly.
    Regards,
    Johan
    Attachments:
    ConfigFileBug.vi ‏20 KB

    Hi Tikus,
    you try to save a space. deep inside the config files spaces at the end (or beginning) of the line are removed. Perhaps you should save the space as as a " " (inside quotes)
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Editing a PDF file with Acrobat XI pro... some "text" is not selectable and vanishes upon saving

    Hi folks.
    I've googled around for a few hours, but I'm completely stumped with this one.
    I'm trying to edit a .pdf file that was generated from Word 2007.  Mostly it edits fine, but for reason some of what appears to be text isn't selectable with the text and image editor... in fact it doesn't even have a bounding box around it.  When I move around the document or save it in acrobat pro, the "text" then vanishes.
    I include a dropbox link to a partial screenshot image which shows what I'm talking about.  You can see that the italic bold A doesn't have a box around it in some cases.
    https://www.dropbox.com/s/42i8xms78lvw12b/Screenshot%202014-02-07%2011.19.07.png
    Can anybody kindly shed some light on what I'm doing wrong? 
    Thanks! 
    -- gyre --

    Hi Bill.  Thanks for replying. 
    Unfortunately, I don't have the option of using the original DOCX file.  The author lost it, leaving only the pdf around
    I'm using AA XI 11.0.06.  Upgraded this morning.  That's running on Windows 7 Ultimate 64.
    I get the boundary boxes by clicking on the 'edit text and images' tool, and they appear.  Or don't in this case
    I only need to change a few characters in the file.   However, even just opening up the file in AA and then saving, the "A = " "text" gets deleted.
    Could it perhaps be something to do with embedded or missing maths fonts on my machine?  I mean, I don't get any warnings, just can't do anything with the A and AB italic bold text.
    Thanks!
    -- gyre --

  • I can´t edit the text files with SAP BODS 3.2

    Hello
    I can not edit some text files 9-20 megabytes to replace two words in each file, the source is a text file and the same destination but with different name, because with the same name have been unable . My idea is to remove the original and stay with the new performing edition but that if he does , let me file this way:
    SALES_ORDERS_FULL_20140223_150051_006.xml ( ORIGINAL )
    should leave it with me so : SALES_ORDERS_FULL_20140223_150051_006.xml _OLD (AMENDED )
    but strangely leaves me so :
    MICROSOFT_SQL_SERVER_KCC-BI_REPO_KHSA_XI_REPO_KHSA_XI_1543_5434_2_3_Long_INVOICES_INCREMENTAL_20140225_034004_001_xml_dat.txt  (not deseased)
    The type of data you use is long since varchar not allow me because it cuts my data file , use varchar (50000000) but takes the information and short .
    I am using long data type , modify the file and I pass the name of the text files of sap bods for global variables. They are a series of files that are called by a while loop
    Thanks for your answers
    regards

    HIr
    Yes, first I convert long_to_varchar for edit, and convert varchar_to_long.
    I edit before before and later
    Thanks

  • Editing a swf file with Adobe Flash cc or Dreamweaver

    Hi,
    I have a .swf file which is embedded in to a html file, I need to make changes in the swf section of the file which Dreamweaver can not help me with it.
    I tried to click on the swf file and take it to Flash cc, but still I can not edit and make changes.
    If I dont have the fla files, I can not edit the .swf file at all?
    I have all the applications of the creative cloud but couldnt find any of them helpful in this matter.
    Is there any help?
    Thanks,

    I have no experience with any decompilers beyond possibly attempting to trial one once.  The only one I have seen recommended is made by Sothink.
    Here is a link to a page with a tool that has an interface you can use to determine various properties of an swf file, including the Actionscript version.
    http://blog.sitedaniel.com/2009/11/swf-info-width-height-swf-version-actionscript-version- framerate/

  • Edited a .jpg file with MSPaint, edit doesn't show up in Dreamweaver. ?

    In my images folder for my website are several .jpg files. I edited the .jpg file in MS Paint.  I added a few blue pixels to stand out.  Then I reopened Dreamweaver MX in local view, looked at the .jpg with Preview in Browser/Firefox, and there were no blue pixels.  I assume that the image must be permanently cached somewhere on my computer that I can't change.  Uploading the file didn't help.  Reloading dreamweaver didn't help.  Windows XP, Dreamweaver MX.  This just started a few days ago.
    I posted this on another of these adobe forums, but then I saw that nothing had been written on the forum in 2 months and that I was one of the most active participants, and I'm pretty new.

    Paul Klinkman wrote:
    It's a new day so the computer was powered down and back up.
    I deleted the image from the page.  I used "add image" and found the image.  I have the same old image, the one that should have no longer existed.  No dice.  Note that this process doesn't involve Firefox in any way that I can see.
    You say "the one that should have no longer existed". Does that mean that it does indeed exist? I mean... physically, is the original image still in the folder? It just seems to me that it would be impossible to "select" an image or even a version of it, that no longer exists. It's like if you paint a red door yellow, there's no chance that one day you will walk past it and it will suddenly be red again all by itself.
    Another thing, have you tried renaming the edited image to something nowhere close to the original? If youdo that, and remove/add it, and it still shows the original image of a different name, then you'v e got some serious problems.
    Message was edited by: Expatriated Mac User

Maybe you are looking for

  • Problem with java and flex web service

    Hi, I have a basic web service written in java using jax ws 2.1 ri. I need to call it from Flex using the WebService class Annotations for the java web method : @WebMethod public void Login( @WebParam(name="server") String serverURL, @WebParam(name=A

  • My 3g ipad will no longer sync with my 4g phone

    Does anyone have a solution?

  • HP Slate 5000 and SP1

    Could not load SP1 on my HP Slate 500 with Windows 8. I talked to support and they recommended a manual load instead of using Windows Update on the Microsoft site. The manual load worked.  Reference support case[Personal Information Removed]?

  • Rename a set of files in Power Shell

    Hello Scripting Guys, I am trying to rename a group of files in a given directory.  The files all start with a number and a dash (such as "1 - " or "24 - ") when I first get them. Sometimes there are files that do not start with a number or a dash in

  • How to upload data for me01 using LSMW BDC METHOD

    *hi export please tell me the complete procedure for uploading data in me01 using LSMW BDC METHOD* Moderator message: please search for available information/documentation. Edited by: Thomas Zloch on May 8, 2011 10:06 PM