Choose file without invisibles Leopard

I'm having a problem with choose file without invisibles (Leopard).
The line
*choose file with prompt "Select a file" as string default location path to home folder without invisibles*
shows an open dialog with all invisible files (those whose names start with a .) are visible.
What's wrong?
Is it a bug in Leopard Applescript?
Something weird on my machine?
Or is this what is supposed to be? If yes, how do I get no invisibles?
Berend

It's the literal way AppleScript interprets your command "path to home folder without invisibles"
It assumes you're applying a parameter to "path to home folder", and if you use a parameter when one is not expected, it can be with or without anything.
*path to home folder without kangaroos*
Works and parses equally well, as does
*path to home folder with sausages*
But by including the braces you're isolating "path to home folder" and applying the "without invisibles" parameter to "choose folder".
Cheers,
H

Similar Messages

  • In Snow Leopard, there was a quick look feature that allowed you to look at files without opening the program.  It doesn't show up in Lion on my iMac.  Any ideas?  Thanks

    In Snow Leopard, there was a quick look feature that allowed you to look at files without opening the program.  It doesn't show up in Lion on my iMac.  Any ideas?  Thanks

    While in Finder, select the file (click on its icon once) then press the Spacebar.

  • Choose file name in Snow Leopard

    In Leopard, when I run the StandardAdditions command *choose file name* and I click on an existing file listed in the resulting *Choose File Name* dialog, the +entire file name including file extension+ is placed into the *Save As:* text box, and that is what is returned when I click the Save button.
    In Snow Leopard, when I do the same, only the file’s +base name+ is placed into the text box, and only the +base name+ is returned.
    I need the Leopard behaviour.

    hungryjoe wrote:
    Appending a filename to the returned result is rather trivial
    Trivial? Consider, in Leopard and before:
      |    set f *to choose file name*
      |    +(* At this point, f is a file specifier and exactly one of the following is true:+
      |          +• the file specified by f does not exist; or+
      |          +• the user wants to overwrite the file.+
      |     +And the file specified by f is exactly what the user chose. *)+
    That’s one line. Compare that to Snow Leopard:
      |     property FileNameExtension : ".pdf"
      | 
      |     repeat
      |           set f to +POSIX file+ ((POSIX path of ( *choose file name* )) & FileNameExtension)
      |           try
      |                 alias f
      |           *on error* number -1728 +-- can’t get reference; i.e. file does not exist+
      |                 *exit repeat*
      |           *end try*
      |           try
      |                 tell application "System Events" *to get the* name *of the* result
      |                 *display alert* "“" & the result & "” already exists. Do you want to replace it?" ¬
      |                       message "A file or folder with the same name already exists. " & ¬
      |                             "Replacing it will overwrite its current contents." ¬
      |                       as warning ¬
      |                       buttons {"Cancel", "Replace"} ¬
      |                       default button "Cancel" ¬
      |                       cancel button "Cancel"
      |                 if button returned *of the* result is "Replace" *then exit repeat*
      |           *on error* number -128 +-- User cancelled+
      |                 +-- ask again+
      |           *end try*
      |     *end repeat*
      | 
      |     f
      |     +(* At this point, f is a file specifier and exactly one of the following is true:+
      |           +• the file specified by f does not exist; or+
      |           +• the user wants to overwrite the file.+
      |     +But the script has had to force a file name extension on the user,+
      |           +so the file specified by f is not actually what the user chose. *)+
    You might do it differently as a matter of style, but you can’t do it simpler and you can’t do it shorter.
    (Rant: do you have any idea how much fiddling it took me to come up with
      |           set f to +POSIX file+ ((POSIX path of ( …
    to work around the fact that AppleScript doesn’t do what the AppleScript Language Guide says on pages 43 and 88.)
    Perhaps you should file a bug report/feature request, however you see it at [http://bugreport.apple.com>.
    I’ll do that tomorrow.

  • Find and sort all files in folder without invisible files

    Hi all,
    I am trying to check whether the newest file added to a folder is an HTML file. In theory the folder should be empty when a new file is added because the script will delete all files in the folder just before it finishes running.
    However, I am having a problem with .DS_Store files being created automatically in the folder. When Finder accesses the folder it creates a new .DS_Store file and thus the newest file added to the folder is never an HTML file.
    I believe that the command "without invisibles" could help me with this problem. However, I have not been able to implement this successfully. I would appreciate if someone could please point me in the right direction. Here is what I have so far.
    tell application "Finder"
              set sortedFiles to reverse of (sort (files of thisFolder) by modification date) as alias list
              set newestFile to item 1 of sortedFiles
    -- check if newestFile is an HTML file
    -- read file and send contents to another application
    end tell
    Thanks for your help!
    Message was edited by: dsbird

    Errr...  A quick reality check is called for. If you make files visible to the finder then they are no longer invisible files, so ignoring invisible files won't help you one bit. your best bet is to do a manual check for a file that starts with a "." (which would normally be invisible):
    tell application "Finder"
              set thisFolder to folder "Pictures" of home
              set sortedFiles to (sort (files of thisFolder) by modification date) as alias list
              set newestFile to last item of sortedFiles
              if name of newestFile starts with "." then
                        set newestFile to item -2 of sortedFiles
              end if
    end tell

  • I bough a Mac Pro 2010 second hand and deleted all the files without backing up now is asking me for the Apple ID of the person who installed maverick,any ideas

    I bough a Mac Pro 2010 second hand and deleted all the files without backing up now is asking me for the Apple ID of the person who installed maverick,any ideas

    If the Mac's firmware was updated, you can try this Internet Recovery:
    Hold down Command + Option + R during restart or bootup; hold until you see a spinning globe (takes up to 10 minutes). Once in the Utilities window, use Disk utility to wipe the drive, then return to the window and choose to reinstall OS X. If that works, the OS will be installed without being tied to an Apple ID.
    FWIW, if the firmware was updated, you will not be able to use the Snow leopard disk to install - I just did several tests and it does not work. You can, however, possibly install the SL onto an external drive and then clone it to the internal or (if you have a clone), boot from that and clone it back - I just tested that as well.
    If the firmware was not updated, then you can use the SL install disk.

  • How to replace or remove last 500 bytes of a file without rewriting all the file?

    Hi everyone,
    Usually I only ask for help when I can't find a solution for several days or weeks... And guess what? That just happen!
    So, this is what i am trying to do:
    I have a program to ZIP folder and protect them with password, then it encrypts the zip file.
    That it's working fine, until the user forgets his password.
    So, what I want to do is give the user a Recovery Password option for each ZIP file created. I can't use the Windows Registry because the idea is to be able to recover the password in any computer.So i came up with an idea...
    In simple terms, this will work like this:
    0 - Choose folder to ZIP
    1 - Ask user for recover details (date of birth, email etc)
    2 - ZIP folder with password
    3 - Encrypt ZIP file
    4 - Encrypt recover details and convert it to HEX
    5 - Add recover details (in HEX) to the end of the ZIP file (last bytes)
    6 - Add "5265636F76657244657461696C73" which is the text "RecoverDetails" in HEX
    7 - Add "504B0506000000000000000000000000000000000000" this is the final bytes of a ZIP file and will make the Operating System think that is a ZIP file (i know that will give an error when we try to open it.. the ideia is to change the
    extension later and use my software to do all the work to access this ZIP/folder again)
    So, explaining what it's here, I want to say that I managed how to do all of this so far. The point number 6 will help us to determine where the recover details are in the file, or if they actually exist because user can choose not to use them.
    In order to unlock this ZIP and extract it's contents, I need to reverse what I've done. That means, that  need to read only the last 500 bytes (or less if the file is smaller) of the ZIP and remove those extra bytes I added so the program can check
    if the user is inputing a correct password, and if so decrypt contents and extract them.
    But, if the user insert a wrong password I need to re-add those bytes with the recover details again to the ZIP file.
    The second thing is, if the user forgets his password and asks to recover it, a form will be shown asking to insert the recover detail (date of birth, email etc), so we need to reed the last 500 bytes of the ZIP, find the bytes in number 6 and remove the
    bytes before number 6, remove bytes in number 6 and number 7, and we will have the recover details to match against the user details input.
    I have all done so far with the locking process. But i need help with the unlocking.
    I am not sure if it's possible, but this what i am looking for:
    Read last 500 bytes of a file, remove the bytes with recover details and save the file. Without reading the whole file, because if we have a 1GB file that will take a very long time. Also, i don't want to "waste" hard drive space creating a new
    clone file with 1GB and then delete the original.
    And then add them back "in case user fails the password" which should be exactly the same.
    This sounds a bit confusing I know, even to me, I am writing and trying to explain this the better I can.. Also my English is not the best..
    Here it goes some code to better understanding:
    'READ LAST 500 BYTES OF ZIP FILE TO CHECK IF IT CONTAINS RECOVER DETAILS
    Dim oFileStream As New FileStream(TextBox_ZIP_to_Protect.Text & ".zip", FileMode.Open, FileAccess.Read)
    Dim oBinaryReader As New BinaryReader(oFileStream)
    Dim lBytes As Long = oFileStream.Length
    oBinaryReader.BaseStream.Position = lBytes - 500
    Dim fileData As Byte() = oBinaryReader.ReadBytes(500)
    oBinaryReader.Close()
    oFileStream.Close()
    Dim txtTemp As New System.Text.StringBuilder()
    For Each myByte As Byte In fileData
    txtTemp.Append(myByte.ToString("X2"))
    Next
    Dim RecoveryDetailsPass_Holder = txtTemp.ToString()
    'Dim Temp_2 = txtTemp.ToString()
    'RichTextBox1.Text = txtTemp.ToString()
    If txtTemp.ToString.Contains("505245434F47414653") Then
    'we have password recovery details(the numbers mean RecoverDetails in HEX)
    'next we will get rid of everything before and after of string "cut_at"
    Dim mystr As String = RecoveryDetailsPass_Holder 'RichTextBox1.Text
    Dim cut_at As String = "505245434F47414653"
    Dim x As Integer = InStr(mystr, cut_at)
    ' Dim string_before As String = mystr.Substring(0, x - 1)
    Dim string_after As String = mystr.Substring(x + cut_at.Length - 1)
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace(string_after.ToString, "")
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace("505245434F47414653", "") ' this is RecoverDetails in HEX
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace("504B0506000000000000000000000000000000000000", "") ' this is the bytes of an empty zip file
    'AT THIS POINT WE HAVE ONLY THE RECOVER PASSWORD DETAILS (date of birth, email etc) IN THE VARIABLE "RecoveryDetailsPass_Holder"
    '////////////////////////////////////////////////////// TO DEBUG
    'MsgBox(string_after.ToString & "505245434F47414653")
    'InputBox("", "", string_after.ToString)
    '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ TO DEBUG
    'Temp_2 = Temp_2.Replace(RecoveryDetailsPass_Holder.ToString, "")
    Now that we have the recover details, we need to remove them from ZIP in order to the software try to unzip it with the password provided by the user on the GUI.
    If the user needs to recover the password we have the details already in RecoveryDetailsPass_Holder variable and just need to match them against user input details.
    If the user fails, we need to put the RecoveryDetailsPass_Holder back on the file.
    Any question just ask, it's a bit trick to explain i think, but please ask.
    Anyone know how to do this?
    Many thanks in advanced.
    Nothing is impossible!
    @ Portugal
    Vote if it's helpfull :)

    @ ALL
    Thank you very much for you help. I know that if I'm "playing" with bytes you should assume that I know a lot of VB.net, but I don't know that much unfortunately. I am not a beginner but I am still very fresh and I probably do stuff that work but
    probably not in the best way...
    Anyway, I will explain the idea of this little software I'm making. Once I wanted to create a program to protect folders with password, and I came up with something to change folder permissions to lock access to them, and that actually worked fine and quickly.
    However, I managed how to "crack" the protection by going to folder properties, security tab and then give permissions back to my username. So that, to me, wasn't a safer system to protect folders, also I want the ability to use passwords. So I search
    and search online for a way to do it, and someone replied (to someone with the same question as me) that the best option would be to create a zip with all contents of the folder, with password and then change the extension from .zip to .whatever and register
    the new extension .whatever on the Windows Registry, so that file will have an icon and open with my software.
    So I did...The program zips everything, change the extension and I added the encryption to avoid people changing the extension to ZIP or trying to open with 7-Zip or similar and be able to see the protected files names in the .zip/.whatever
    Answering to all of you now:
    @Armi
    "System.IO.FileStream.SetLength"
    I know I tried that but I erased the code because it didn't work for some reason, I don't remember why sorry, was long time before I created this post.
    The last code I was trying to use was this:
    ' Set the stream position to the desired location of the stream.
    Dim fileStream As IO.FileStream = _
    New IO.FileStream(TextBox_ZIP_to_Protect.Text & ".zip", IO.FileMode.Append)
    Try
    ' Set the stream (OFFSET) position to the desired location of the stream.
    fileStream.Seek(210, IO.SeekOrigin.Current)
    Dim Bytes_do_ZE As Byte() = HexStringToByteArray(Temp_2.ToString)
    'Write Characters ASCII
    For Each Byte_Do_Zeca As Byte In Bytes_do_ZE
    fileStream.WriteByte(Byte_Do_Zeca)
    Next
    Finally
    fileStream.Close()
    End Try
    and we need this:
    Private Shared Function HexStringToByteArray(ByRef strInput As String) As Byte()
    Dim length As Integer
    Dim bOutput As Byte()
    Dim c(1) As Integer
    length = strInput.Length / 2
    ReDim bOutput(length - 1)
    For i As Integer = 0 To (length - 1)
    For j As Integer = 0 To 1
    c(j) = Asc(strInput.Chars(i * 2 + j))
    If ((c(j) >= Asc("0")) And (c(j) <= Asc("9"))) Then
    c(j) = c(j) - Asc("0")
    ElseIf ((c(j) >= Asc("A")) And (c(j) <= Asc("F"))) Then
    c(j) = c(j) - Asc("A") + &HA
    ElseIf ((c(j) >= Asc("a")) And (c(j) <= Asc("f"))) Then
    c(j) = c(j) - Asc("a") + &HA
    End If
    Next j
    bOutput(i) = (c(0) * &H10 + c(1))
    Next i
    Return (bOutput)
    End Function
    That code, as I understand, is to search for the OFFSET of the bytes in the file and start to write from there... That OFFSET should be the beginning of the 500 bytes read on the code before. I got the OFFSET position "210" reading the file with
    the HEX editor "HxD - Hexeditor v1.7.7.0" but using the OFFSET won't work because every file, password, recover details and so on, are different and so the file size, changing the OFFSET I
    think.
    @Reed Kimble
    Does that sound like something which might work for you?
    Thanks for your help. That might be some solution, however it seams a bit of the same problem where we need to read the bytes again to get the recover details. But, as I said in this post, because this is meant to password protect folders, do you think that
    will apply as well?
    @Crazypennie
    Thanks for your reply.
    All this appears really weak. The user has your application since he need it to open the file .... and the code in the application contain the code to read the file without knowing the password. Therefore anyone can read your code and retrieve the
    data without the password ... if he knows VB.
    The application can only open the file if the user didn't use a password to protect the file. Because the file is encrypted and needs to be unencrypted first.
    When the application tries to open/read the file, will need to decrypt it first and then check for a password and do the validation. Also the application is with the code masked/protected which i think it might not be easy for reverse engineering.
    - You need to use a web server and a symmetric key encryption
    This a good idea, besides I don't know how to implement it. However the idea is to be able to:
    1 - Protect a folder anywhere in any Windows computer (portable app)
    2 - Recover password details (security question) in any computer, online and offline
    And I think we need a computer always connected to the Internet to use that method, right?
    @ Mr. Monkeyboy
    Thank you very much for your effort.
    I just wanted to let you know that the zip method you are using is no longer supported.
    I didn't actually knew that. Thanks for letting me know.
    Do you require the compressed encrypted files to actually be Zip files or could they just be compressed files that have nothing to do with Zip?
    No, it doesn't need to be a .zip extension. I am actually using my own extension. It starts as a Zip but then I changed to my own extension which I have registered on the Windows Registry.
    @ ALL
    Thanks again to all for trying and spending time helping me.
    By the way, I might not be able to answer or try any code during the weekend... It's easter break and family is around. Have a nice easter everyone. :)
    Nothing is impossible! Imagination is the limit!

  • Saving a PDF file when printing is not supported. Instead, choose File Save.

    I am using Mountain Lion (10.8.2) and I was using Adobe Reader version 9. In the past, I've always been able to print to file using the File -> Print dialogue but all of a sudden it stopped working. I read somewhere that installing the latest version of Adobe Reader (version 11) would remove the old printer, so I did so. It took me about an hour on version 11 to even find the pdf print to file option, but I am getting the same message. For what it's worth, when I try print to file from Microsoft Word, I have no problem. I have no idea why things changed all of a sudden, but does anyone have any idea how I can get this working again?

    I checked with Adobe.  No luck. 
    Allow me to clarify my problem: 
    I have Adobe Reader XI. I also use a Mac--imac and a MacBook Pro.   My adobe was updated on 12/24.  Prior to that point, I could open my print dialogue box and there was a PDF tab on the bottom left.  In the drop down menu there were many choices, including but not limited to Open in PDF Preview, Print PDF, Save PDF, email PDF.  If I selected one page of 30 pages from a document saved in Adobe, I could extract just that one page and save it or email it, without having to send the entire document.   After the update, when I open a PDF file using ADOBE READER XI, and then open the print dialogue box, and follow those same steps, I get the message "Saving a PDF file when printing is not supported. Instead, choose File > Save."   My question is why is this feature now unavailable and is there a way to fix it? 
    The answer I got from Adobe was that Adobe never had this function, so it must have been via my print or preview programs..which are apple.  Does anyone have any thoughts?
    Thank you.
    https://forums.adobe.com/message/7124567 

  • Mac Pro Lion 10.7.5 will not receive bluetooth file from Macbook Leopard 10.5.8

    Since late 2008, I have been running a 2.2GHz / 3,1 / 4GB MacBook, now at 10.5.8. A few days ago I bought a 2.66 GHz / 1,1 / 6GB Mac Pro, now at 10.7.5. I can not seem to get the Lion Mac Pro to successfully receive a 3.3mb file sent, via BLUETOOTH, from the Leopard Macbook. Sending the file, from the Leopard MacBook, usually, fails and gives the message, "There was an error connecting to the device". A few times I did get an incoming file alert on the Mac Pro and the file seemed to begin coming from the MacBook; however, the estimated time varied wildly and the file transfer eventually failed and displayed the aforementioned message. I have an android 2.3.6 phone and I was able to successfully send the same 3.3mb file to the Mac Pro in a matter of a minute, or so. I may downgrade the Mac Pro to 10.5.8, because I have important software/hardware that may not be supported on Lion, but, right now, I am trying to determine compatibility with my important Leopard software/hardware. For the time being, I want to send files to the Mac Pro via BLUETOOTH, as opposed to any other transfer method.

    I don't know the answer to your problem, but until you resolve it do not upgrade OS X.
    I would suggest you try a reinstall:
    Reinstall Lion, Mountain Lion, or Mavericks without erasing drive
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu.
    Reinstall Lion, Mountain Lion, or Mavericks
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • File sharing with leopard and lion

    Can OS X Lion (10.7.5) able to file share with leopard OS X (10.5.8)?
    Kappy and I tried to get it to work with file sharing from my macbook air to g5-  vice versa
    Apparently finder wont work when we attempted to file share.

    Anyone???
    how do i get my friend to set up  to access my mac from other state on his mac??
    so he can access to my info anytime without asking me.
    how do i create user name and password for him?
    PLEASE PLEASE HELP!! ITS IMPORTANT!!!

  • Write xmp sidecar files without need to export masters - script

    I've written a script to write xmp sidecar files for referenced and online images (the 2 conditions in the script) of the selected images. I looked for a while at system events and other stuff to be able to write the xmp file, but i'm not a programmer, so in the end i chose the long and dirty way to do it.
    This script will export all iptc expanded fields as aperture does (creating basically the same file). It can be easily adjusted to include other tags, even custom ones. I don't know how to get at the adjustments for images, otherwise those could be included as well.
    If anyone has the energy to clean this up and make it faster, feel free to do so. Next, I'm going to try to write a script to do the opposite, import xmp sidecars for imported online and referenced files.
    Here it goes (thanks to Brett Gross for the database part to find the master filename):
    --script to create sidecar xmp files for referenced files without having to export masters. parts of the script (finding the file name) are by brett gross
    property p_sql : "/usr/bin/sqlite3 "
    global g_libPath
    on run
    my getLibPath()
    --counter for processed images, reset, just in case
    set mastercount to 0
    tell application "Aperture"
    if not (exists selection) then
    display dialog "You have to select at least one image" buttons {"OK"} default button 1
    return
    else
    display dialog "You have selected " & (count of selection) & " images." & return & "Continue?" default button 1
    end if
    set theSel to selection
    --run through the selected images
    repeat with currentpic from 1 to count of theSel
    tell item currentpic of theSel
    -- only apply to referenced and online images
    if referenced and online then
    set mastercount to mastercount + 1
    set curID to id
    --find the master file path and name - this part by brett gross, thanks
    set libPOSIX to POSIX path of g_libPath
    set libDBPOSIX to (libPOSIX & "/Aperture.aplib/Library.apdb") as string
    set theScript to p_sql & (quoted form of libDBPOSIX) & " \"select ZFILEUUID from ZRKVERSION where ZUUID='" & curID & "'\""
    set ZFILEUUID to do shell script theScript
    # ---------- Get the master's path
    set theScript to p_sql & (quoted form of libDBPOSIX) & " \"select ZIMAGEPATH from ZRKFILE where ZUUID='" & ZFILEUUID & "'\""
    set ZIMAGEPATH to do shell script theScript
    # ---------- Get the master's disk name
    set theScript to p_sql & (quoted form of libDBPOSIX) & " \"select ZFILEVOLUMEUUID from ZRKFILE where ZUUID='" & ZFILEUUID & "'\""
    set ZFILEVOLUMEUUID to do shell script theScript
    set theScript to p_sql & (quoted form of libDBPOSIX) & " \"select ZNAME from ZRKVOLUME where ZUUID='" & ZFILEVOLUMEUUID & "'\""
    set diskName to do shell script theScript
    set imgPath to (diskName & "/" & ZIMAGEPATH)
    --end brett gross part
    --strips extension, seems to work for files and paths with more than one period
    set oldlim to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "."
    try --remove last extension only
    set contador to text item -1 of imgPath
    set noExtension to Unicode text 1 thru -((count of contador) + 2) of imgPath
    on error --handle files with no extensions
    set noExtension to imgPath
    end try
    set AppleScript's text item delimiters to oldlim
    --create the file and path name with the .xmp extension for writing
    set xmpPath to "/Volumes/" & noExtension & ".xmp" as Unicode text
    --convert posix path to alias for easier write and read handling
    set xmpPath to POSIX file xmpPath as file specification
    -- header for xmp file
    set xmpheader to ("<?xpacket begin='' id=''?>
    <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9-9, framework 1.6'>
    <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>") & return
    -- footer for xmp file
    set xmpfooter to ("</rdf:RDF>
    </x:xmpmeta>
    <?xpacket end='w'?>") & return
    --xmp content, part 1
    --check for existence of iptc tags, create content or empty string depending on existance of tags
    if (exists IPTC tag "Contact") or (exists IPTC tag "Country/PrimaryLocationCode") then
    set xmpcontentpartone to ("<rdf:Description rdf:about='' xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>") & return
    try
    set CountryCode to value of IPTC tag "Country/PrimaryLocationCode"
    set xmpcontentpartone to xmpcontentpartone & tab & "<Iptc4xmpCore:CountryCode>" & CountryCode & "</Iptc4xmpCore:CountryCode>" & return
    end try
    try
    set CreatorContactInfo to value of IPTC tag "Contact"
    set xmpcontentpartone to xmpcontentpartone & tab & "<Iptc4xmpCore:CreatorContactInfo>" & CreatorContactInfo & "</Iptc4xmpCore:CreatorContactInfo>" & return
    end try
    set xmpcontentpartone to xmpcontentpartone & ("</rdf:Description>") & return
    else
    set xmpcontentpartone to ""
    end if
    --xmp content, part 2
    --check for existence of iptc tags, create content or empty string depending on existance of tags
    if (exists IPTC tag "Category") or (exists IPTC tag "City") or (exists IPTC tag "Country/PrimaryLocationName") or (exists IPTC tag "Credit") or (exists IPTC tag "DateCreated") or (exists IPTC tag "Headline") or (exists IPTC tag "Province/State") or (exists IPTC tag "Source") or (exists IPTC tag "SpecialInstructions") or (exists IPTC tag "SupplementalCategory") or (exists IPTC tag "Writer/Editor") then
    set xmpcontentparttwo to ("<rdf:Description rdf:about='' xmlns:photoshop='http://ns.adobe.com/photoshop/1.0/'>") & return
    try
    set Category to value of IPTC tag "Category"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:Category>" & Category & "</photoshop:Category>" & return
    end try
    try
    set City to value of IPTC tag "City"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:City>" & City & "</photoshop:City>" & return
    end try
    try
    set Country to value of IPTC tag "Country/PrimaryLocationName"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:Country>" & Country & "</photoshop:Country>" & return
    end try
    try
    set Credit to value of IPTC tag "Credit"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:Credit>" & Credit & "</photoshop:Credit>" & return
    end try
    try
    set DateCreated to value of IPTC tag "DateCreated"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:DateCreated>" & DateCreated & "</photoshop:DateCreated>" & return
    end try
    try
    set Headline to value of IPTC tag "Headline"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:Headline>" & Headline & "</photoshop:Headline>" & return
    end try
    try
    set State to value of IPTC tag "Province/State"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:State>" & State & "</photoshop:State>" & return
    end try
    try
    set Source to value of IPTC tag "Source"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:Source>" & Source & "</photoshop:Source>" & return
    end try
    try
    set Instructions to value of IPTC tag "SpecialInstructions"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:Instructions>" & Instructions & "</photoshop:Instructions>" & return
    end try
    try
    set SupplementalCategory to value of IPTC tag "SupplementalCategory"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:SupplementalCategory>" & SupplementalCategory & "</photoshop:SupplementalCategory>" & return
    end try
    try
    set CaptionWriter to value of IPTC tag "Writer/Editor"
    set xmpcontentparttwo to xmpcontentparttwo & tab & "<photoshop:CaptionWriter>" & CaptionWriter & "</photoshop:CaptionWriter>" & return
    end try
    set xmpcontentparttwo to xmpcontentparttwo & ("</rdf:Description>") & return
    else
    set xmpcontentparttwo to ""
    end if
    --xmp content, part 3
    --check for existence of iptc tags, create content or empty string depending on existance of tags
    if (exists IPTC tag "Byline") or (exists IPTC tag "Caption/Abstract") or (exists IPTC tag "CopyrightNotice") or (exists IPTC tag "Keywords") or (exists IPTC tag "ObjectName") then
    set xmpcontentpartthree to ("<rdf:Description rdf:about='' xmlns:dc='http://purl.org/dc/elements/1.1/'>") & return
    try
    set creator to value of IPTC tag "Byline"
    set xmpcontentpartthree to xmpcontentpartthree & tab & "<dc:creator><rdf:Seq><rdf:li>" & creator & "</rdf:li></rdf:Seq></dc:creator>" & return
    end try
    try
    set description to value of IPTC tag "Caption/Abstract"
    set xmpcontentpartthree to xmpcontentpartthree & tab & "<dc:description><rdf:Alt><rdf:li xml:lang='x-default'>" & description & "</rdf:li></rdf:Alt></dc:description>" & return
    end try
    try
    set rights to value of IPTC tag "CopyrightNotice"
    set xmpcontentpartthree to xmpcontentpartthree & tab & "<dc:rights><rdf:Alt><rdf:li xml:lang='x-default'>" & rights & "</rdf:li></rdf:Alt></dc:rights>" & return
    end try
    --keywords, slightly different, as they need to be written as a list and not as a string
    --i don't think it's a problem if we create an empty list if there are no keywords present.
    set xmpcontentpartthree to xmpcontentpartthree & tab & "<dc:subject><rdf:Bag>" & return
    --make list item for every keyword
    try
    repeat with n from 1 to count of keywords
    set cursubject to name of (keyword n)
    set xmpcontentpartthree to xmpcontentpartthree & tab & tab & "<rdf:li>" & cursubject & "</rdf:li>" & return
    end repeat
    end try
    set xmpcontentpartthree to xmpcontentpartthree & tab & "</rdf:Bag></dc:subject>" & return
    try
    set title to value of IPTC tag "ObjectName"
    set xmpcontentpartthree to xmpcontentpartthree & tab & "<dc:title><rdf:Alt><rdf:li xml:lang='x-default'>" & title & "</rdf:li></rdf:Alt></dc:title>" & return
    end try
    set xmpcontentpartthree to xmpcontentpartthree & ("</rdf:Description>") & return
    else
    set xmpcontentpartthree to ""
    end if
    --part four. aperture doesn't seem to export anything there
    set xmpcontentpartfour to "<rdf:Description rdf:about='' xmlns:photomechanic='http://ns.camerabits.com/photomechanic/1.0/'>
    </rdf:Description>" & return
    --part five. rating
    set xmpcontentpartfive to "<rdf:Description rdf:about='' xmlns:xap='http://ns.adobe.com/xap/1.0/'>" & return
    try
    set Rating to main rating
    set xmpcontentpartfive to xmpcontentpartfive & tab & "<xap:Rating>" & Rating & "</xap:Rating>" & return
    end try
    set xmpcontentpartfive to xmpcontentpartfive & "</rdf:Description>" & return
    --join everything
    set xmptext to xmpheader & xmpcontentpartone & xmpcontentparttwo & xmpcontentpartthree & xmpcontentpartfour & xmpcontentpartfive & xmpfooter
    --write file
    my writexmpFile(xmptext, xmpPath)
    end if
    end tell
    end repeat
    display dialog "Processed " & mastercount & " referenced and online image(s)." buttons {"OK"} default button 1
    end tell
    end run
    -- write xmp sidecar file routine
    on writexmpFile(theContents, xmpFileName)
    --tell application "Finder"
    try
    open for access xmpFileName with write permission
    set eof of xmpFileName to 0
    write (theContents) to xmpFileName starting at eof
    close access xmpFileName
    on error
    try
    display dialog xmpFileName
    close access xmpFileName
    end try
    end try
    --end tell
    end writexmpFile
    --this part copied from Brett Gross-------------------------------------------------------------------------- --------------------------------
    on getLibPath()
    tell application "System Events" to set p_libPath to value of property list item "LibraryPath" of property list file ((path to preferences as Unicode text) & "com.apple.aperture.plist")
    if ((offset of "~" in p_libPath) is not 0) then
    -- set p_posix to POSIX file p_libPath
    set p_script to "/bin/echo $HOME"
    set p_homePath to (do shell script p_script)
    set p_offset to offset of "~" in p_libPath
    set p_path to text (p_offset + 1) thru -1 of p_libPath
    set g_libPath to p_homePath & p_path
    else
    set g_libPath to p_libPath
    end if
    end getLibPath
    --end brett gross part

    imigra wrote:
    I've written a script to write xmp sidecar files for referenced and online images (the 2 conditions in the script) of the selected images. I looked for a while at system events and other stuff to be able to write the xmp file, but i'm not a programmer, so in the end i chose the long and dirty way to do it.
    This script will export all iptc expanded fields as aperture does (creating basically the same file). It can be easily adjusted to include other tags, even custom ones.
    Excellent stuff!
    I don't know how to get at the adjustments for images, otherwise those could be included as well.
    They are stored as binary data in the Version XML files at the bottom level of the Library package. You can also have a look around in the ZRKIMAGEADJUSTMENT table, but again the actual settings for each adjustment are in binary form.
    If anyone has the energy to clean this up and make it faster, feel free to do so.
    As far as I can remember, Aperture uses the 'proper' IPTC tag names when accessing them via AppleScript, so you may be able to do a loop through all the IPTC tags for each image, rather than picking out each specific one. But that would need checking. The EXIFTools site is a good place to find out about the different ways that IPTC data can be described.
    Next, I'm going to try to write a script to do the opposite, import xmp sidecars for imported online and referenced files.
    Don't rush unless you feel like it - I've already started planning out a free (as in beer and speech) XMP importer with a GUI so that you can choose how to map the XMP CORE tags that don't exist in Aperture. You've given me an extra idea, though - if we can decide on a set of custom tags, my importer could map the XMP CORE tags to them and your exporter could export those tags.
    Thanks for the work!
    Ian
    P.S. I'll check through your script tomorrow, some of the database tables changed between 1.5.6 and 2.0, so you might need to add in a version check to be really thorough.

  • How to Attach a File Without Embedding It on Mail?

    How to Attach a File Without Embedding It on a Mac?
    Tamer is not working and I prefer not to use TERMINAL (defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes)
    Right click send as icon is not a solution.
    Any other options? Thanks!

    bbp@bcn wrote:
    I always receive the same response, "Can you send it as an attachment?"
    and I think It does something to do with the way I send files.
    Thanks
    It's nothing to do with the way you send them. Every mail client chooses how to cope with attachments: in some there is a preference setting but in many cases it automatically displays embedded images. Even where there is a preference setting it's up to the person receiving the email: you can't control it. Why are they so fussed about your sending as an attachment? The image can be saved easily enough, usually by dragging it to the Desktop, or by a button to save attachments. If they really want this you are going to have to zip it, there isn't any other way round it.

  • "choose file name" loses the extension when clicking a file

    I'm using the "choose file name" command in a script but when I click on an existing file it loses the extension.
    Apparently the same problem as here:
    http://discussions.info.apple.com/message.jspa?messageID=10410632
    Is there a workaround for that ? Or is it just impossible to retrieve the needed extension ? (and we need to wait for Apple to fix that...)

    Hello
    Well, not that I know a work-aronud except for the obvious to type the extension manually...
    Since I cannot think of any good reason for the command's interface to drop the extension deliberately, I'd classify this as bug.
    You'd better send feedback to Apple requesting fix.
    *If you send bug report via bugreport.apple.com, you'd likely get duplicate notice saying that it has been already reported. So try general feedback channel :
    http://www.apple.com/feedback/macosx.html
    The more users want it to be fixed, the more chances for it to be fixed.
    Regards,
    H
    P.S. By the way, 'choose file name' command had not let user choose existing file (with existing files grayed out in dialogue). It is rather new feature letting user select existing file. Perhaps 10.5 (AppleScript 2.0) and later, I guess. Defect in new feature should be able to be fixed easily without breaking backward compatibility.

  • Batch export .ai to .png produces files without extension - please help

    I created an Action to batch export a folder of .ai files to create 300dpi .png's of the .ai file's artboard. I did this by simply recording "Export...as png" with my desired settings then Batch running the Action on desired folder of .ai files.  The files were successfully exported, the trouble is that the exported files lack a .png file extension. My intent is to take these PNG files and
    merge them into a single PDF using Acrobat Pro. Unfortunatly, without the .PNG extension, Acrobat Pro does not recognize the file types and does not let me use the Combine Files feature on them. Going back and manually adding a .png at the end of the exported files defeats the time-saving purpose of Batch Processing all together. Is there something I am missing or doing incorrectly? I have included screenshots of 1) My Batch Action settings 2) folders showing files without .png extension and 3) visual of what I see when I am trying to combine PNGs into a PDF. Assistance would be greatly appreciated!
    - Erin

    Yes, I am on a Mac running Snow Leopard 10.6.8 with CS5 (Illustrator 15.0.2, Acrobat Pro 9.4.6). Your suggestion did not help as "Hide Extension" is not checked. I even set "Open With" to Acrobat Pro and still get no extension or ability to import into Combine in Acrobat. Thanks anyhow. Please see below.

  • Save file without JFileChooser in specific directory

    hi!
    can you save a file without opening a JFileChooser dialogue to a specific directory??
    the problem I have got is not how to address to the directory but how to save the file....
    could someone help me please?
    thx
    charly

    If u only want to save the file instead of selecting from the filechooser then you should use
    JFileChooser fc = new JFileChooser();
    int retVal = fc.showSaveDialog(frame);
    if(retVal == JFileChooser.APPROVE_OPTION)
    String filename = fc.getSelectedFile().getName();
    getName() will give file name and getAbsolutePath() will give the full path.
    filename -> is the file name that u entered for saving in the field. I am not sure if this what u wanted. Hope this helps otherwise pls be more specific in ur question.
    Selvi.
    I was pondering the same question. if I just open the
    dialog, instead of choosing a file from a directory, I
    want to type in a new file name, and save it.
    help is appreciated.

  • Files without extensions not recognizing program

    Recently I used my new lacie firewire drive to transfer files from my G4 to a PC laptop. Now the files on the Lacie (when I work on the G4) are missing their icons. Only files without the extension .ai, .m4a etc. Some files will open via right click and choose the program. Some will not open at all.
    In every folder there is now a finder.dat and resource.
    I read in a recent post about the finder.dat and resource. And now understand the relationship to the PC. This has never happened on my older Lacie drive which I've used between computers.
    Is there a repair program I can run on the Lacie?

    But for now is there a way to salvage the files that are
    gray rectangles. So that they can recognize the program
    from which they were created?
    First, you do get credit for using some method of backing up. Thats more than many users do
    If the files with generic icons were created on another Mac, and they will not open (or prompt you for a program to open), then you likely no longer have either an old copy of the program that created the file, or you do not have the OSX version of the program that created them, or both.
    Given they are from a G3, I would suspect they are looking for a Classic based program, not an OSX based program.
    First question: Is Classic installed on your new machine?
    If not, you may want to install it. Presuming your G3 was up to OS 9.2.2, you should be able to simply copy the System Folder (Os9), as well as the Applications (OS9) folder from the G3 to the external to the G4.
    Second question: Based on your folder structure, can you determine what program you originally used to create the file(s)?
    If the answer to question 2 is yes, then try opening that program (or the latest version thereof) first, then using it's open... command to open the file that you cannot 2x click.
    Once you successfully open the file in (whatever program), save the file. This should 'update' the file, change the icon, and make it 2x clickable from the finder.
    If the files with generic icons were created on the PC, then you will need the Mac equivalent of the program, or a program you know can open the file. For these files, once again open the application, then use it's open... command to get to the file.
    Keep in mind there may be some files you simply cannot open or run on the Mac. There are way too many to list, but some of the most common will be .MDB (MS Access),DLL,PIF,COM, EXE,CAB, & MSI.

Maybe you are looking for

  • Photosmart plus b209a-m with osx 10.8.4 not recognize wireless

    I had photosmart plus b209a printer with my macbook pro. It has wireless, but I have no idea how to set up it? I didn't install the cd, because I found out I just plug in the usb with my macbook pro will print it. Do I need to install cd first, but I

  • Auto generated scroll bars won't go away

    I used the following sample script provided by macromedia to create a scrolling text area powered from a text file and css file, but when I move on to another part of the FLA., the scroll bars generated by this script remain - on top of other layers.

  • Subcontract with full payment of excise duty

    hi gurus Can any one provide me itutor link of subcontract with full payment of excise duty,import cycle,import under custom bonded ware house Thanks in advance Roc

  • Survey Form Porlet not show

    Hello, I am trying to publish a survey in Oracle Portal (Version 10.1.4). After a bit of Research I added the Survery Creator Portlet to a Portlets Region of a Page, and designed the Survey. This wasn't a problem. Afterwards, I added Survey form port

  • Oracle Treasury "Retail term money"

    Hi all, We are implementing Oracle Treasury (version ebs 11.5.10.2) We have some bank accounts with agreement with the bank to earn interest rate from the balance of each amount of money deposited at the bank account. For example: we have USD1million