Quick question...  thank you in advance

I am a a beginner in AppleScript, but not in programming. I am trying to write an AppleScript that will get the contents of a folder, open the files in TextEdit and print them.. My code cannot open any of the documents in the folder... code below:
Can you help?
Thank you.
tell application "Finder"
set theFolder to choose folder with prompt "Please select a folder of items to process"
set theFolderItems to (list folder theFolder without invisibles)
repeat with a from 1 to length of theFolderItems
set thing to (item a of theFolderItems)
set targetFile to theFolder & thing
tell application "TextEdit"
open targetFile
print targetFile
end tell
end repeat
end tell

The problem is when you create targetFile. theFolder is type: alias and thing is type:string. When compund them with & the alias is not coerced to string so targetFile ends up being a list with two values not a single string.
So a few ways to do this. Here is one that works around having to build the file alias for opening.
=============================================
tell application "Finder"
set theFolder to choose folder with prompt "Please select a folder of items to process"
try
set theFolderItems to entire contents of theFolder as alias list
on error
set theFolderItems to entire contents of theFolder as alias as list
end try
repeat with targetFile in theFolderItems
tell application "TextEdit"
open targetFile
print targetFile
end tell
end repeat
end tell
=============================================

Similar Messages

  • TS2446 I forgot the security question about what was my first car and what is my favorite car! What is the solution to change that? please help me, thank you in advance Leo

    I forgot the security question about what was my first car and what is my favorite car! What is the solution to change that? please help me, thank you in advance Leo

    If you have a rescue email address set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address set up then go to Express Lane  and select 'iTunes' from the list of 'products' in the middle of the screen.
    Then select 'iTunes Store', and on the next screen select 'Account Management'
    Next choose 'iTunes Store Account Questions' or 'iTunes Store account security' (it appears to vary by country) and fill in that you'd like your security questions/answers reset.
    You should get an email reply within about 24 hours (and check your Spam folder as well as your Inbox)

  • Hi , i'm new here and i would like to ask a question about iPad 2 . Well , actually when i hold my finger on any icon , its not jiggling , i need to fix the icons . May i know what can i do in this case ? thank you in advance ,

    Hi , i'm new here and i would like to ask a question about iPad 2 . Well , actually when i hold my finger on any icon , its not jiggling , i need to fix the icons . May i know what can i do in this case ? thank you in advance ,

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • I have itunes on old dell desktop and older ipod, bot Macbook air...when i plugged ipod into air to try to put music library on the Air itunes, i got a erase and sync message....will this put my itunes library on my new air?  thank you in advance!

    I have an old dell desktop and an older ipod with my itunes library....the dell desktop is not functioning as well and have not been able to sync a newer ipod to the library .....i now have a newer Macbook air....i would like to put my library on my Air i tunes....when i attached the ipod to the air to try to sync the ipod library onto the air itunes i received a message that said i was synced with another library and that if i wanted to sync with this library i would need to "erase and sync" ....got spooked as i dont want to lose the library/ or the music....question ----will this procedure put my existing library (which is all on my older ipod) onto my Macbook air itunes?...any help would be greatly appreciated...thank you in advance...

    No, it will sync the ipod to the content of the MBA which presumably has nothing on it (= erasing content of iPod and replacing it with nothing).
    Ideally:
    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    do not confuse moving your whole folder and library with moving just media files as in
    iTunes for Mac: Moving your iTunes Media folder - http://support.apple.com/kb/HT1449
    Quick answer if you let iTunes manage your music:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Start iTunes with the option key held down and guide it to the new location of the library.
    Macworld - How to transfer iTunes libraries between PC and Mac - http://www.macworld.com/article/46248/2005/08/shiftitunes.html
    Move an iTunes library from a Windows PC to a Mac - http://www.macworld.com/article/1146958/move_itunes_windows_mac.html
    if you absolutely must use the iPod:
    Post by Zevoneer: iPod media recovery options - https://discussions.apple.com/message/11624224 - this is an older post and many of the links are also for old posts, so bear this in mind when reading them.
    Commercial software utility for transferring songs from i-device to Mac - http://www.fadingred.com/senuti/
    http://support.apple.com/kb/HT1848 - just media purchased from iTunes Store

  • How can I remove password from firmware?  Thank you in advance!!!

    This is really causing problems & wreaking havoc on my notebook.   Does or has anyone had experience with this, and if so, how did YOU resolve this???
    Thank you in advance to anyone who responds to my question!!!!!

    This is what I was told by Apple Support on the phone (I had a nasty crash & lost my Max OS X operating system) Luckily I was planning to update to the newer release of Mac OS X Snow Leopard, & backed up all my files just a fww hours before it happend..I currently have version10.7.5).  The woman I spoke to said having a Firmware password really causes a lot of problems....so why did it ask me for a password?? I do not understand!!
    I could swear I read somewhere if you login as Administratror; you could eliminate this password.  My system is finally back up & working. I added a seconday unrestricted login (which I should have done anyway as I know better than that!!).  I am going to check a few things out & will definotely let you know the outcome.  Thank you very much for your quick response!!!!

  • Fife days App Store not give it to me the verify code, I made I lot email adress, changed and create the new, still the same problem, and this is second one iPad that I bought this month, if not help me I don't know how to deal, thank you in advance

    Fife days App Store not give it to me the verify code, I made I lot email adress, changed and created the new, still the same problem, and this is second  iPad that I bought this month, if not help me I don't know how to deal, thank you in advance, maybe I will go to shop and want my money back

    Do you have a technical question for us volunteer users?

  • HT1349 I lost/had my iPhone stolen. Tried using Find My iPhone and it's offline. It was set up. What do I do now? Do I report it stolen? What is the best way in getting back my iPhone if any? Thank you in advance.

    Tried using Find My iPhone and it's offline. It (Find my iPhone) was set up. What do I do now? Do I report it stolen? What is the best way in getting back my iPhone if any? Thank you in advance.

    Find My iPhone is good for misplaced iPhone but not good for thief and it was never meant to be.
    You chance of getting it back is very small.
    There are a few things you can try.
    Try remote lock/wipe your iPhone through Find My iPhone.
    https://www.icloud.com
    You can report to the police, cell carrier (expensive cell charges for international calls, roaming etc)
    Change all the passwords used in iPhone: Apple ID, E-mail, Bank Account ....
    http://support.apple.com/kb/HT2526

  • I gave my ipad 2 to my brother last month. After that he erased all content and settings, sign in with his apple id. The next day until now, I found out that I can not udpate my apps both on my iPhone and iPad Air. What should I do? Thank you in advance.

    I gave my ipad 2 to my brother last month. After that he erased all content and settings, sign in with his apple id. The next day until now, I found out that I can not udpate my apps both on my iPhone and iPad Air. I had create new apple id, change my password, delete the icloud acc. But still I can not update my apps. I have many of red notifications on iPhone and iPad Air. What should I do? Thank you in advance.

    1. It is never a good idea to include personal info like your email address or Apple ID in a post on an open forum.
    2. The email you received DOES NOT say your Apple ID cannot be used to unlock this iPad. The email informs you that your Apple ID was used to unlock an iPad. Fortunately the iPad is yours. The message confirms that. If your Apple ID was used to unlock an iPad that was not yours your would then know to change your password. Since the iPad is yours you do not need to change your password.
    Is your iPad working?

  • HT1364 How do I move photos from a Dell computer to be able to show them on an iPad 2 and Apple TV 3?  Thank you in advance.

    How do I move photos from a Dell computer to be able to show them on an iPad 2 and Apple TV 3?  Thank you in advance.

    Open itunes, connect ipad, select what you want, sync

  • Hi all, can someone please help. I'm trying to transfer Game Center data (games, achievements/scores and friends) to a new Game Center account. Thank you in advance :)

    Trying to transfer all Game Center data to a new Game Center account. Thank you in advance. Much appreciated.

    I am having the same problem
    after the update to 5.0.1
    I mean updating shouldn't become a task that everyone will dread

  • The map of Republic of Armenia in iOS 6 is not good. Please help us. Thank you in advance. Maps

    The map of Republic of Armenia in iOS 6 is not good. Please help us. Thank you in advance. Maps

    Hi Naren,
    When I double-click on this data type from the ABAP editor, it takes me to the definition screen.I wish I could put screenshots in this message but I don't know how. Anyway, the definition says it is a "table" type. There are four tabs underneath - Attributes, Line Types, Initialization, and Access Key. Under "Line Type," the properties are as follows:
    Predefined Type
      Data Type: STRING
      No. of Characters: 0
      Decimal Places: 0
    Thank you in advance for your help.
    Peter

  • When syncing my iphone 6 plus, i now get an error that reads, "IP address conflicts with another system or network."  How can i eliminate this error permanently?   Thank you in advance!

    when syncing my iphone 6 plus, i now get an error that reads, "IP address conflicts with another system or network."  How can i eliminate this error permanently?   Thank you in advance!
    This never happened before, however the last couple of months it comes up every time I plug my USB from PC to iphone.

    HyperNova Software,
    Thank you so much.  Because I am very computer illiterate, could you help me on how to get started?  I don't have the slightest on where to get started, the steps to follow, etc.
    Can't thank you enough for your help!

  • Somehow I can't hear people talking on my iphone 4 either when calling or being called. I've bought this one for half a year. I need your help~Thank you in advance.

    Dear Iphone fans,
    Recently, somehow I can't hear sounds when talking on my iphone4 either when calling or being called. When asking them later, they said they can hear me but my sound become very low and unclear. And I can't hear a thing at that time. Could anyone tell me how I could fix the problem.
    I've bought this one for half a year. I need your help~
    Thank you in advance.

    Dear Iphone fans,
    Recently, somehow I can't hear sounds when talking on my iphone4 either when calling or being called. When asking them later, they said they can hear me but my sound become very low and unclear. And I can't hear a thing at that time. Could anyone tell me how I could fix the problem.
    I've bought this one for half a year. I need your help~
    Thank you in advance.

  • I accidently deleted my url box at the top of safari. I believe I did this with the command key. Can anyone help me get it back? Thank you in advance!

    I accidently deleted my url box at the top of safari. I believe I did this with the command key. Can anyone help me get it back? Thank you in advance!

    Right click (cntl-click) on the top of the bar and select "customize toolbar".  Drag the default set back in.
    Regards,
    Captfred

  • I bought a cd with Lightroom 5. After installation and registration I am not able to use 'help' function and I cannot update the software. I anyone able to give me a hint how to handle it? Thank you ind advance Karl

    I bought a cd with Lightroom 5. After installation and registration I am not able to use 'help' function and I cannot update the software. Is anyone able to give me a hint how to handle it?
    Thank you in advance
    arl

    Hi Keith, sorry for my late reply.
    Surely I am able to connect to the help function when Icontact the website
    of AdobeLR5.The problem is as follows,
    When I open LR5 on my computer and work with it and try to open the help
    function in the software, I don't get it.
    When I bought the CD I was naiv enough to believe that I get an independent
    working software. I learned in the meantime, that the seller does not allow
    to work with, without being connected to them.
    I don't believe that I am paranoid, but I like to buy something and use it
    without to inform the supplier that I do it. Otherwise I could have bought
    the license fpr LR5 via internet.
    Best regards
    Karl
    2015-01-02 13:42 GMT+01:00 kglad <[email protected]>:
        I bought a cd with Lightroom 5. After installation and registration I
    am not able to use 'help' function and I cannot update the software. I
    anyone able to give me a hint how to handle it? Thank you ind advance Karl
    kglad <https://forums.adobe.com/people/kglad?et=watches.email.outcome>
    marked Keith_Reeder
    <https://forums.adobe.com/people/Keith_Reeder?et=watches.email.outcome>'s
    reply on I bought a cd with Lightroom 5. After installation and
    registration I am not able to use 'help' function and I cannot update the
    software. I anyone able to give me a hint how to handle it? Thank you ind
    advance Karl
    <https://forums.adobe.com/thread/1669640?et=watches.email.outcome> as
    helpful. View the full reply
    <https://forums.adobe.com/message/7059196?et=watches.email.outcome#7059196>

  • Can someone send me the link to the stand alone version of light room 5 were I can buy it. Thank you in advance

    Were can I found the stand alone version of lightroom 5?

    Rob,
    Thank you so much.
    In one way or another I managed to purchase the upgrade of lightroom instead of full version.
    It is now corrected, thank you so much
    Best Regards,
    Fredrik
    18 aug 2014 kl. 11:11 skrev Rob Cole <[email protected]>:
    Can someone send me the link to the stand alone version of light room 5 were I can buy it. Thank you in advance
    created by Rob Cole in Photoshop Lightroom - View the full discussion
    If you go to the main Lightroom page - where most links take you to cloud signup, at the very bottom, click on "Products" - scroll down to 'Lightroom'..
    Products
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6649902#6649902
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Lightroom by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

Maybe you are looking for

  • Adobe Acrobat 9 - Print certain webpage as PDF file but some of its contents were corrupted

    Print certain webpage as PDF file but some of its contents were corrupted as non-readable alphanumeric. Preview of the PDF file shown OK but when printed, its contents were corrupted. Adobe Acrobat 9 Professional reinstalled but problem persists.

  • Search results not getting directly through google from address bar?

    when searching from address bar, search is getting referred to mywebsearch bar search engine and then to google. It's not directly going for google. I have uninstalled all the traces of mywebsearch bar by using "exterminate", registry cleaners etc. P

  • Wireless Network Management with Multiple SSIDs in one Wireless Profile

    Could anybody explain me about how Multiple SSIDs in one Wireless Network Name (Network Profile) ? Configuration will be pushed to Windows 7 Pro from Wins Server 2008 R2. Objective: Multiple office locations will have different SSIDs and when the lap

  • How do I switch from photography plan to a student plan?

    Hello!! I currently have the creative cloud photography plan as a one year subscription but I want to switch to the student plan. Is there a way I can do this without paying to cancel the subscription I have now? Thanks!

  • Upgrade requirements

    I wish to upgrade from PSE5 to PSE7 on my new Windows Vista (64-bit) machine. According to the upgrade eligibility requirements, I must have: "Any version of Photoshop Elements, Photoshop Album, Starter Edition, Photoshop LE or PhotoDeluxe. To instal