AppleScript - Writing to non-existent directories, and non-existent files..

All,
AppleScript - Writing to non-existent directories, and non-existent files...
Creating directories several levels deep on the fly.
How do we write to a file that does not exist, buried deep down in a hierarchy of directories that don't exist either...
In trying to do this I explored two options. One used AppleScript, assisted by UNIX, which was simplicity itself, the other one used only AppleScript and was considerably more complex, and slower.
http://www.mac-specialist.com/r/asckdirs.html
Hope these are useful,
Best Regards,
Bill Hernandez
Plano, Texas

Simplified code examples - lacking extensive error checking -
UNIX example 001:
set file_Name to "Sales Figures.txt" -- File to create.
set file_Path to "2006 Sales:Forecast:Fruits:Flordia:Oranges:Large" -- Folder to create.
set UNIXfilePath to (quoted form of (POSIX path of file_Path))
try
do shell script "mkdir -p " & UNIXfilePath -- Attempt to create a folde, and respective intermediary folder(s).
end try
try
do shell script "touch " & UNIXfilePath & "/" & file_Name -- Attempt to create a blank file.
end try
UNIX example 002:
set file_Name to "Sales Figures.txt" -- File to create.
set file_Path to "2006 Sales:Forecast:Fruits:Flordia:Oranges:Large" -- Folder to create.
try
do shell script "mkdir -p " & (quoted form of (POSIX path of file_Path)) -- Attempt to create a folde, and respective intermediary folder(s).
end try
-- Create a file, and enter some text.
set FREF to open for access file (file_Path & ":" & file_Name) with write permission
write "Beispieltext" to FREF
close access FREF
AppleScript example:
set file_Name to "Sales Figures.txt" -- File to create.
set file_Path to "2006 Sales:Forecast:Fruits:Flordia:Oranges:Large" -- Folder to create.
-- Obtain list of text items of 'file_Path'.
set {oAStID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
set filePathList to text items of file_Path
set AppleScript's text item delimiters to oAStID
tell application "Finder"
set folder_Path to name of startup disk -- Obtain name of boot disk.
repeat with i in filePathList -- Cycle through list.
try
make new folder at folder_Path with properties {name:i} -- create folder.
set folder_Path to folder_Path & ":" & i -- Create new path for next new folder.
end try
end repeat
end tell
-- Create a file, and enter some text.
set FREF to open for access file (folder_Path & ":" & file_Name) with write permission
write "Beispieltext" to FREF
close access FREF
  Mac OS X (10.4.4)  

Similar Messages

  • Exact Difference between Non Stock NLAG and Non Valuated  UNBW Materia type

    Dear All
    What is the Exact Difference between Non Stock NLAG and Non Valuated  UNBW Materia type?
    I tried creating Purchase Order and found that accouting doc got created at both times and stock was not updated in MMBE for both material types.
    Regards

    Hi,
    non-valuated material (Material Type UNBW):
    This type of material is managed on a quantity basis, but not on a value basis. This makes sense for materials of low value, stocks of which nevertheless have to be monitored (for example, operating manuals).
    Non-stock material (NLAG) (Material Type NLAG):
    Inventory management is not possible for these materials either on a quantity or value basis. For frequently required consumables, the use of this material type nevertheless enables you to store the information required to create
    purchasing documents (such as texts and units of measure).
    When a material is procured directly for consumption, no material master record is necessary. In connection with consumable materials, you can distinguish between the following cases:
    • Consumable material without material master record
    • Consumable material with material master record that is not subject to
    inventory management (on either a quantity or value basis)
    • Consumable material with material master record that is subject to inventory management on a quantity, but not a value, basis
    Regards,
    Pardeep malik

  • In Adobe ExportPDF, can you take an existing PDF and delete existing pages?  For example, I have a 5-page report and need to delete pages 2-4.  Is this possible?  Thanks!

    In Adobe ExportPDF, can you take an existing PDF and delete existing pages?  For example, I have a 5-page report and need to delete pages 2-4.  Is this possible?  Thanks!

    Hi,
    You can do this with Adobe Acrobat.
    If you are using Export PDF it is a long procedure.
    You need to convert your PDF in word or powerpoint.
    Then you can edit the document & again can create PDF.
    Regards,
    Florence

  • Traversing all directories and listing all file objects

    Hi
    I am wondering if someone can help me out.
    In IFS, I would like to traverse recursively down all directories starting from a particular directory to be set by me, and collect all objects that are file objects, say in an Array of PublicObjects. However the listing should exclude folder objects. Obviously the folder objects would be used to traverse further down the directory tree and collect more (file) PublicObjects.
    I have tried a few things but I can't seem to distinguish between folder and file objects. If someone could provide me with a code example to get me started that would be tremendously appreciated.
    Thanks very much.
    Hugo

    Can you not just test for an instance of Folder?

  • Upload directories and/or multiple files

    What's the easiest way to let a user upload multiple files or entire directories? I know the html input file tag only allows one per text box, but i would like the user to be able to select groups of files or specify an entire directory to upload. Could somebody help me with this?, thanks in advance

    Yes Thru a web browser!!!... but i don't want to force the users to click the browse button everytime they want one or more files. I need something that will allow me to click shift or control and select multiple files or just a directory. Anything you can know about it please just let me know it?

  • Order of directories and files listed by the ls command

    Per default, the "ls" command lists directories and non-directories separately in lexicographical order.
    Is there a possibility to change that order of listing and sorting?
    For example, if I want "ls" to list my directories and files not by name but by change date +per default+ without using any additional options, what will I have to do?
    Is there a command or a setting which influcenes "ls"'s order of sorting?

    I don't think the defaults for ls can be changed as it is a compiled binary located in /bin. Besides compiling your own version of ls, one solution is to add lines such as the following to /etc/profile or (presuming you're using BASH) ~/.bash_profile and opening a new Terminal window:
    alias l="ls -l"
    alias ll="ls -la"
    I have two such lines in my own profile so that when I type "l" followed by the return key I get the output of "ls -l" and issuing "ll" gives me a listing of dot-files, too.
    Probably not exactly what you were looking for but it does simplify the command issued at the command line and avoid compiling your own.
    hth,
    Johnnie Wilcox
    aka mistersquid

  • EMIEsitelist and EMIEuserlist hidden directories and dat-files

    2014-04-05
    Cross-posted from
    http://answers.microsoft.com/en-us/windows/forum/windows8_1-security/erniesitelist-and-ernieuserlist/00407bd2-e349-423c-a8e5-cb6127840ea5
    Original Post dated April 21, 2014
    EmieSiteList and EmieUserList
    Microsoft Security - Privacy Concerns
    I found two unknown directories on my PC in my user profile.  I have, so far, been unable to identify what put them there, which process owns them, and when I delete them (using Admin escalated privileges) they come back after a few minutes or immediately
    after reboot.
         c:\users\USERNAME\appdata\local\EmieSitelist\container.dat
         c:\users\USERNAME\appdata\local\EmieUserlist\container.dat
         C:\Users\USERNAME\AppData\LocalLow\EmieSiteList\container.dat
         C:\Users\USERNAME\AppData\LocalLow\EmieUserlist\container.dat
    It was time, anyway, so I wiped the drive using factory low-level overwriting and performed a clean install of Windows 8.1 Pro using a freshly downloaded ISO from Microsoft; one with an ESD distribution, written to a new just out-of-the-bedamned-hardshell-plastic
    flashdrive..
    I just completed the clean install, in this sequence:
    Boot to flashdrive and let Windows create partitions then install.  Reboot.  Check AppData; no folders found.
    Activate.  Check AppData; no folders found.
    Run first Update; install everything except Bing Bar and Desktop.    Check AppData; no folders found.  Reboot.  Check AppData; no folders found.
    Add Feature Windows Media Center.  Check AppData; no folders found.  Reboot.  Check AppData; no folders found.
    Run Updates a second time.  Check AppData; no folders found.  Reboot.  Check AppData; no folders found.
    Remove MS C++ v12 x86 and x64 installed during Update.    Check AppData; no folders found.  Reboot.  Check AppData; no folders found.
    Download from MSDN (http://msdn.microsoft.com/en-us/vstudio/default) Redistributables MS C++ x86 and x64, 2005, 2008, 2010, and 2012.4 versions, and install in sequence.  Check AppData
    after each install; no folders found.  Reboot after each install and check AppData; no folders found.
    Run Updates a third time.  Response was No Updates Available.  Check AppData; no folders found.
    Reboot.  Check AppData; all four sub-directories are now present.
    These sub-directories and dat-files are not, so far, present in the AppData\Roaming directory.
    There is nothing except Microsoft Windows 8.1 Pro WMC and the 10 MS C++ packages installed; and MS Silverlight and AMD (videocard) Catalyst Control Center on the machine.  Windows Defender is present but is installed as part of Windows 8 and 8.1;
    and its' updates are provided via the MS Update process.  All - repeat ALL of these items are provided by Microsoft.
    My questions are:  What are the Emie directories for; what program created them, and what does the various container.dat files "contain"?  And . . . if not absolutely necessary, How do I get rid of them and keep them from coming back?
    First attempt at Solution:
    Permissions are Full for System, USERNAME, and group Administrators.  The USERNAME is the Owner, and Effective Permissions for each of the 3 is Full.
    Open Command Prompt (Admin)
    C:\Windows\system32>cd\
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\Local\EmieSiteList\container.dat
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\Local\EmieSiteList
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\Local\EmieUserList
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\Local\EmieUserList\container.dat
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\LocalLow\EmieUserList\container.dat
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\LocalLow\EmieUserList
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\LocalLow\EmieSiteList
    C:\>attrib -r -h +s C:\Users\USERNAME\AppData\LocalLow\EmieSiteList\container.dat
    C:\>
    BOTH Files and Directories are no longer Hidden.  The Directories still show that the files within are READ-Only, but checking the actual file shows that it is no longer R-O.
    I then deleted each of the 4 directories and  closed Windows (File) Explorer.
    After less than 3 minutes reading pages on the internet (at Microsoft's Ask Windows Community), I opened Windows Explorer to check and found that the sub-directories had re-created themselves in both the Local and LocalLow directories.
    The container.dat files were back in the Local sub-dir and after another few minutes, also back in the LocalLow sub-dir.
    Both the sub-directories and the container.dat files are once again Super-Hidden.
    Analysis using Windows utilities and SysInternals and NirSoft tools have not identified which object or process or service owns these objects.
    ADDED:  My system is a home system, not connected to any work domain via VPN or otherwise.  WHY is the Windows Update Team not spending time to implement condition-and-error-checking to ensure that unneeded updates, services, and changes are not made
    without the system owner/operator permission?  Further, WHY is this particular issue so hard to find info about; what is being kept from customers and why?

    Dear sir Shovel Driver,
       About:  EMIEsitelist  and  EMIEuserlist
    .., hidden directories and dat-files
    Internet Explorer 11 (on Windows 7 and Windows 8.1) provides increased performance, improved security, and support for the modern technologies like HTML5 and CSS3 that power today’s Web sites and services. By adding better backward compatibility with
    Enterprise Mode, Internet Explorer 11 now helps customers stay up to date with the latest browser—and facilitates using the latest software, services, and devices.
    IE11 Enterprise Mode can be set in the Group Policy Console, or by adding a
    Registry setting:
    REGISTRY:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer]
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main]
    "EnterpriseMode"="Disable"
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode]
    Or a edit a Group Policy setting, which you can find under:
    [Windows-Key]+[R]->[Run]->Type here:
       gpedit.msc
    Press [Enter], with an UAC Warning:
    Do you want to allow the following program to make changes on this computer:
    gpedit.msc ?
    Select/Press: Yes
    Go to in the Left pane of the GPedti.msc Window:
      Computer Configuration
      Administrative Templates
      Windows Components
      Internet Explorer
    Change / Add at right list, down under:
      "Use the Enterprise Mode IE website list"
    Set this option to - whatever you need;  Disabled,
    Enabled (Default is: Not Configured)
    When Enabled, you need to add a list with Web-Sites, Domains or Web-Pages.
    This policy setting lets you specify where to find the list of websites you want opened using Enterprise Mode IE, instead of Standard mode, because of compatibility issues. Users can't edit this list.
    If you enable this policy setting, Internet Explorer downloads the website list from your location
      (HKCU or HKLM\Software\policies\Microsoft\Internet Explorer\Main\EnterpriseMode),
    opening all listed websites using Enterprise Mode IE, Web-Sites are seperated by a sign: "
    If you disable or don't configure this policy setting, Internet Explorer opens all websites using Standards mode.
    Now to
    properly close and conclude this
    mystery:
    EMIEsitelist and EMIEuserlist
    .., are hidden directories and dat-files
    Thses directories and dat files are used to store data for the IE11
    EnterpriseMode.
    It is not a: Virus, neither it is a Trojan, Hoax, KeyLogger or anything else bad.
    TECHNET Sources:
     Turn on Enterprise Mode and Use a Site List (Deploy):
     http://technet.microsoft.com/en-us/ie/dn262703.aspx
     What is Enterprise Mode?:
     http://technet.microsoft.com/library/dn640687.aspx
    If you find this usefull, please Vote at the button
    "I Find This Usefull"
    Thank you! ;)
    Best regards, MPVS
    MP|VS

  • Non Existent Directories in EBS 12.1.1- IBM AIX 7.1

    Hi All ,
    We are facing issues while installing Oracle EBS r12.1.1 in IBM AIX 7.1 we have 2 servers one for apps and one for DB.
    We are getting non existent directories like /data1/r12 and certain links are poiting to this wrong directory.
    need some expert help in this.
    -Raj

    raghuraj wrote:
    HI EBSDBA,
    Thanks .There was no /etc/oraInst.loc.
    Saw you also faced similar issue long back ,can you pls let me know is that problem with media or something else..
    -RajFirst please create oraInst.loc in /etc as per "verify oraInst.loc" in
    Oracle Applications Release Notes, Release 12.1.1 [ID 798258.1]
    Also, please see
    How to fix Incorrect Soft Links And Oracle_home In 10.1.2 & 10.1.3 Homes [ID 849821.1].
    You must also do md5sum checksum for the installation media you have.
    The problem could be with media and also with oraInst.loc. Please make sure you have all the pre-requisites installed as per
    Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.1.1) for IBM AIX on Power Systems (64-bit) [ID 761569.1]
    Thanks

  • Need help connecting 5th gen Time capsule via wifi to existing wifi network(non-apple) and use ethernet out to AV receiver?

    Could anyone help advise me how to use my 5th gen time capsule airport to connect to my existing wireless modem(non-apple) over the wireless network (NOT using the WAN port with a cable) and then connect with an ethernet cable to give internet connectivity to my AV Receiver?  I would also like to be able to back up my macbook pro with the time machine/time capsule benefit.  I know that many AV setups have recommended using airport express to receive wireless connectivity to pass on internet through the ethernet port to AV setups, but I thought I would try to add the extra functionality of the over-the-air backups with the time capsule at the same time.  Is this possible without connecting with a wire to the modem which has no ability for a wired connection where the TV and AV setup is?   Any help would be much appreciated:)

    It doesn't work except to another apple router. Sorry.
    The express does work.. that is a difference between Express and Extreme/TC.

  • How can I unlock the copy protection of songs that I've acquired some years ago with an old - and non existing anymore - account? Can I link the songs to my new account or do I have to purchase them again?

    How can I unlock the copy protection of songs that I've acquired some years ago with an old - and non existing anymore - account? Can I link the songs to my new account or do I have to purchase them again?

    If you're in the US, you will be able to use iTunes Match for $25 a year to remove copy protection in a few months: http://www.apple.com/icloud/features/
    If you're not, you can't.  You can authorise iTunes with the old account in addition to your current account, so all your songs will play, but I'm not sure what will happen if you try to sync them to an iPod.

  • Since the FF8 update, all bookmarks were lost and none of the recommended methods for restoring lost bookmarks work; I always get "Unable to process to backup file" even though the backup .json files still exist

    Since a FF8 update, all bookmarks were lost and none of the recommended restore methods work, even though I have been able to find the backup ".json" files; I continually get "Unable to process the backup file" for all methods of importing or restoring the bookmarks from the .json files. As others note, I can also no longer add any new bookmarks to my now empty bookmarks tab. My profile has not changed, so that's not the problem. This is really a pain.

    Did you try to delete the file places.sqlite to make Firefox rebuild the places.sqlite database file from a JSON backup?
    *http://kb.mozillazine.org/Unable_to_process_the_backup_file_-_Firefox
    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_places-database-file

  • Does DI 11.7 support exists and non exist in where statment in dataflow

    Hi All
    Does DI support the exists and not exists iin a dataflow. I am getting and error when using it.
    Thanks

    details and options to be found here: https://boc.sdn.sap.com/node/20046

  • Total Tax and Non-Deductible column in Tax report

    Hi all,
    My client is using AU/NZ localization.  We need to customise a Tax report based on existing Tax Report in Financal Report-> Accounting> Tax> Tax Report.
    Does anyone know where to pull the information for colum "Total Tax" and "Non-Deductible"?
    When I look at table CSI4, CSV4, ATX1, VRT1, OVTR, they are all empty.  In addition, I can't find these information in JDT1 as well.
    Appreciate your advice.

    Shwu -
    You cannot pull the tax informatin and non-taxable dollars for a single BP - it would all need to be calculated from invoices and credit memos (at least that is the direction we took).
    You can (i.e. for customers) use calculations and sums with the OINV and INV1 tables - they both have the field of VatSum, I believe.  OINV has DocTotal and INV1 has LineTotal that you can use.  Getting the right calculation with those sums depends a lot on how your customer has determined tax for the BPs (i.e. freight is/is not taxable, discounts, various taxing entities, etc...).
    I do not have the exact SQL in front of me, but I remember something like the following being the key calculation...
    OINV.DocTotal minus the sum of INV1.LineTotals and minus the sum of INV1.VatSums = Non-Taxable  (with my customer it ended up being a lot of freight appearing as non-taxable).  So $1,014.00 (DocTotal) minus $1,000.00 (sum of LineTotal) = $14.00 then $14 minus $9.00 (sum of LineVatSum) = $5.00 as Non-taxable.
    If you want to have the taxing entities to show, then it is a matter of joining in other tables (OSTA, etc...)
    Try writing some SQL in the Demo System SAP provides first - just to get an idea of how it can go...
    Good Luck - that is about as far as I can take you - Zal

  • OBIEE 11g 11.1.1.7 NON Confirmed dimensions and facts

    Hi All,
    In OBIEE 10g if we had non-conformed dimensions we used to work with by defining logical level of the conformed dimensions to grand total and confirmed dimensions to detail in the LTS of the fact table
    and also set metrics to grand total level.
    But in OBIEE 11g doing same is throwing error
    [nQSError: 14025] No fact table exists at the requested level of detail
    How do we achieve this?
    Regards,
    deep

    You need to create a complex join with non conformed dimension and the fact with 1=1 and set the logical level of the measure to total for a non conformed dimension.
    You can refer: https://s3.amazonaws.com/rmc_docs/biforum2011/Mcquigg_Metadata.pdf

  • So I made a new account on my computer for my sister, and none of the music that I put on the computer from CD's i no longer have aren't on there, The purchansed ones are on there.

    So I made a new account on my computer for my sister, she had a lot of music on her ipod, i opened itunes for her and none of the music that I put on the computer from CD's, That I no longer have, are on there, The purchansed ones are on there though. But when i go back and log onto my account all of the music's there. Please help me.

    For music that you've purchased from Apple that are on your iPhone you should be able to copy to your computer's iTunes via File > Transfer Purchases. Also if you are in the US then you should be able to re-download past music purchases for free : http://support.apple.com/kb/HT2519
    For your own music that you've copied, then if you haven't got a backup on, for example, external drives or CDs/DVDs then you could see if any of the utilities mentioned in this old post still exist and work

Maybe you are looking for

  • Can I use Airport Express to extend signal from my Airport Extreme and then run Ethernet from Express to my TV which requires ethernet to access internet?

    As stated in title. I want to access Netflix but my TV requires ethernet connection. I would like to use Express to repeat Exreme sigal and then to TV via Ethernet. I only have one access point in house for cable modem so I'm using Extreme to broadca

  • Condition Type FRb2 Settings

    Hi We hv the condition type as FRB2. Its ans fixed amount. It should be calculated after my Tax value. Means Basic - Disc + P&F + Tax = Value 1000/- From this 1000 i need to add the FRB2 as 150/- so the total shld be 1150 But in my case the FRB2 is c

  • Unity 7 Licensing Question

    Hi all, We recently upgraded Unity 4 to Unity 7 in a-la-carte licensing. As far as my understanding goes the user licensing model in Unity 7 is that all subscribers are UM subscribers and there are no more VM subscribers any longer. Below is a Unity

  • Named ACL and ACE numbering

    I created a new extended named ACL and enter a few ACEs numbered 10,20,30,100,110,1000 to give them plenty of space apart. When I reload the switch, the numbering has disappeared and they are all spaced 10 apart. Why does this happen and is there a w

  • Importing Flash Menu in to Dreamweaver

    Hello I've created a drop down menu in flash using this instructional tool: Everything looks great but now I need to get it into my dreamweaver page. It needs to be inserted into a long, horizontal bar which will contain other drop down menu buttons