AppleScript rename does not lose extension

I wrote the following script:

on f Open

say application 'Finder '.

Repeat with f in f

Set newName to characters 1 through 5 of (get the name of f) as text

the value of f to newName name

end Repeat

end say

end Open


Is there a way to work with files OR folders and if it is a file, not remove the extension of it?


Any help would be greatly appreciated.

Add the following code between the two fixed lines:

If (class f) is not folder then set newName newName & "." & name extension of f

(141149)

Tags: Mac OS & System Software

Similar Questions

  • the AppleScript editor does not work

    Hello

    I have a problem: the applescript editor does not start. When I try to open this program, finder show that the editor is running. But he doesn't show me toolbar, mb air boot costs and in fact, that's all.

    Can someone help me? screen filming wrote: no answer

    Hello sashasonia,

    Looks like the AppleScript editor does not open on your Mac and activity monitor shows that the program is not responding. I know how about them can be when programs and applications do not work as expected and I'm happy to help you to get AppleScript up and run again.

    The first step is to force the AppleScript Editor to quit smoking and then try opening it again. To force the closure of the program, follow these steps:

    To close an application normally, choose leave in the application menu in the menu bar, or press command-Q. If an application does not respond, you can force it to close it using the Force to leave:

    1. Choose force quit from the Apple menu, or press Command-Option-Esc.
      This is to press Ctrl-Alt-Delete on a PC.
    2. Select the application does not respond within the window to leave, then click on force quit.

    Force a nearby application on your Mac.

    If the AppleScript editor does not respond when you try to open it again, restart your Mac. To restart, select the  in the upper left corner of your screen, then "restart". Try again the AppleScript editor once you are logged into your user account.

    If you still can't not to get the editor AppleScript work correctly, follow the steps outlined in the article below to start your Mac in safe mode, and then test the program again. Since starting in safe mode removes certain system and kernel hiding, check your startup disk and tries to fix the problems of directory, you will want to restart your Mac as usual again and test AppleScript editor once more when you are connected to your user account.

    OS X El Capitan: start in safe mode

    Thank you for using communities of Apple Support.

    Take care!

  • Script using AppleScript GUI does not

    Before we go too complicated, I'm starting to get a basic copy/paste using keyboard shortcuts to work. In theory, if I can copy a value of cells in another cell using keyboard shortcuts, I can use keyboard shortcuts, I need more complex scripts.

    Can someone more well informed that I look over the below basic code and tell me what I'm doing wrong?

    (I added the script editor to the security settings for accessibility to allow him to control the computer.)

    My code for a simple copy/paste in figures (other programs also not to answer):

    on run

    say application "Numbers".

    activate

    if not (there are document 1) then error number 1000

    say document 1

    tell the worksheet active

    the value the selectedtable to (the first table whose class of selection range is range)

    the value myRows to count the lines in selectedtable

    say selectedtable

    the value the selection range of cell 2 of rank 3

    sendCopy

    the value the selection range of cell 4 of rank 3

    sendPaste

    end say

    end say

    end say

    end say

    end run


    on sendCopy()

    say application 'Numbers' to Activate

    say application "System events".

    say application process "Numbers".

    key sequence « C »

    end say

    e nd dire

    end sendCopy


    on sendPaste()

    say application 'Numbers' to Activate

    say application "System events".

    say application process "Numbers".

    key sequence « V »

    end say

    end say

    end sendPaste

    Thank you

    Jason

    You favorite the AppleScript Language Guideand then use the appropriate syntax:

    key sequence Using 'C' command down


    key sequence 'V' with the command down


    It may or may not be other contributory factors in your script as to why it does not work.

  • I have firefox 13 and 15 but realplayer download this video option does not work, extensions to save plugin is disabled, if no videos do not play in youtube

    I have Firefox 13 and real player 15, but the download this video option does not work, under extensions to save browser plugin is disabled, but if active videos do not play in youtube, error occurs, it's major drawback, it works well with IE, but I prefer Firefox so any help to rectify the issue is appreciated.

    One possibility is to upgrade to Flash 11.2 and re - activate the Plugin RealPlayer browser Record extension in the Add-ons Manager (Tools > Modules > Extensions) (it's a softblock).

    If you need to return to 11.2 Flash you can download Player Flash 11.2 through this direct link:

    You must uninstall version 11.3 Flash.

  • accidentally deleted my video library of its location. How do I recover and does not lose everything in the folder?

    When I try to view my videos I get a {"Videos.library - ms" are no longer working., this library can be removed safely from your computer.} Records that have been added will not suffer.} Message.

    I looked on the web and everywhere I look it says to remove the folder videos and restoration, but "Note:removal of a library does not delete the contents of the included folders.» "However, you need to add or include your folders manually, if necessary." I don't want to lose anything that is not in a folder.  There is way to much to lose...

    Help, please!

    Right-click the video library (the one with the blue icon) and choose Remove.  It will not erase all files.

    Then right click on the word 'Libraries' and choose 'Restore default libraries'

    And don't worry - even if you make a mistake and you delete the wrong thing, you can recover from the Recycle Bin on your desktop, that's why he's here :)

  • First does not suite extension symlinks for the network drives

    Hey folk from Adobe.

    I'm developing an extension for the first I like to find in a shared network folder. If I place a symbolic link in the extensions folder that points to a path on my local drive, everything works great. Thus, for example, from this directory:

    /Users/ [user] / Library/Application Support/Adobe/CEP/extensions

    I have create this symbolic link:

    extension-My->/some/LOCAL/path/library/first/my-extension

    ... everything works fine. But if I change the symlink to point to a network location:

    extension-My->/some/NETWORK/path/library/first/my-extension

    Then, the extension is not available in first. Is there a reason, that you can think of this first would prefer symbolic links to the locations the over the symbolic links to the network locations?

    See you soon,.

    Raphael

    I can think of many reasons related to security now does not re - runs.

    Extensions must be installed by modules, or ExManCmd; both place files in the correct location.

  • folder.selectedDlg does not HTML5 extension on OSX 10.8.5

    I run this code from ExtendScript IDE and it works beautifully.

    var file = new Folder (path);

    var f = folder.selectDlg (title);

    Return f.toString ();

    When I run my extension of HTML5 he shows the dialog box, but is unable to correctly display the my folder structure, it seems that each new folder I visit figures what files are inside, but it does not display unless I go back a folder, then click in the folder for the second time.

    It's as if the list that shows my files is not updated or refreshes before all my files/folders have been found for this folder.

    Anyone experienced this?

    This is a known bug - I have logged only a few weeks, still no solution on the horizon ;-)

    I agree it's annoying. You can always use the CEP from the HTML Panel, but if you must rely on JSX code there is no work around again (what is? ( Boring!)

    Best,

    Davide Barranca

    www.davidebarranca.com

    www.cs-extensions.com

  • AppleScript: "equal" does not in "repeat to.

    It is a fundamental question of Apple Script.

    If I use one ' if A = test B' inside of a loop 'repeat for A {...} ". (I want to treat differently the values in the set), "A = B' is always false, even if A is equal to B."  This is not a problem outside the loop, so I 'package A to B' and test.

    This script demonstrates the problem:

    (* This part works *)

    Journal ""using \"set aVar to\": "

    game aVar for 1

    testValue (aVar)

    game aVar for 2

    testValue (aVar)

    (* This part does not work *)

    Journal ""using \"repeat with aVar in\": "

    game aList to {1, 2}

    Repeat with aVar in aList

    testValue (aVar)

    end Repeat

    (* This method is used in the two pieces above *)

    (* It tests the ' if A = B operation' *)

    on testValue (variable)

    If variable is equal to 1 then

    Journal 1

    else If variable is equal to 2 then

    Journal 2

    on the other

    Journal 'nor '.

    end if

    end testValue

    Responses resulting (from the log instructions):

    (* using the 'value aVar': *)

    (*1*)

    (*2*)

    (* using the "repeat with aVar in": *)

    (* or *) <-should be (* 1 *)

    (* or *) <-should be (* 2 *)

    In the loop (second part), the 'testValue' method works differently outside the loop (first part) and incorrectly.  The results of both parties must be the same.

    What Miss me?

    Use the following Manager:

    on testValue (variable)

    If (variable number) is equal to 1 then

    Journal 1

    Otherwise, if (variable number) is equal to 2, then

    Journal 2

    on the other

    log 'none'

    end if

    end testValue

    (141084)

  • Photo of renaming does not update html

    Hello

    I'm a new convert to Frontpage 2003, trying to find a solution to some of our old ways I did things. In Frontpage, if I renamed it a file in the folders view, he asked me "Do you want to update these pages so that hyperlinks will not be broken?".

    It seems that there is no function in Dreamweaver CS4 for this. Any ideas?

    Under "create new" on your page main dreamweaver to open, click on "dreamweaver site" and go through the steps. In this way, any changes make you as this will be the large site

  • Why my wifi does not lose connection every 15-30 seconds?

    During the first 4 to 6 weeks, I got the annoying problem of the WiFi dropped connection every 15 to 30 seconds, which makes it impossible to use this computer on a wireless connection. What can I do to fix this?

    Problem solved

    I got the wifi card to uninstall and reinstall. It has worked fine since.

    Thank you

  • Installation of extension Spinner does not work

    I am trying to install the user of Spinner to WebWorks interface and I get the following error in the console to ripple Web Inspector:

    TypeError: 'undefined' is not an object (evaluation of "blackberry.ui.Spinner.open")

    I followed the instructions on the following site:

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/Smartphone/SpinnerControl

    But the site indicates that these instructions are "is no longer up-to-date" and that I should use:

    https://bdsc.webapps.BlackBerry.com/HTML5/documentation/ww_developing/using_the_js_extension_in_your...

    which States I need a jar file.  There is no jar file in the file list.

    Please help to explain what is needed to make the user of available Spinner interface:

    -SDK WebWorks 2.3.0.9

    -Waving 0.9.0.16

    -Windows 7 64 bit

    I think that the ripple does not support extensions, try using a Simulator or real compatible devices

  • iPad 2 turn does not on

    It is responsible.

    the white Apple comes on when I press the power button, and after a bit the screen goes black

    "Home" button does not do anything

    I rebooted with 3 buttons at the same time, no help, once again white apple comes on, but I guess that the device is not powered.

    It is August 31 and the genius bar does not have availability up to seven 5!

    MORE IMPORTANT: I need my Notes!

    Please help if you have a suggestion that does not lose my data :-(

    Thank you

    lailafromca wrote:

    MORE IMPORTANT: I need my Notes!

    If you happened to store your notes on iCloud, they are readily available for you.

    Just use any membership in the http://www.icloud.com browser and all your notes appear!

    Or you can use Notes to any device iOS app to see (on condition, of course, is your device connected to your Apple ID and password).

  • Firefox tells me to upgrade to 10.0.1, but also tells me that my AVG security does not work with the update. What should I do for security? I would jump up to date, but I already blocking problems, which always seems to happen if I don't update to the c

    I want to update, but does not lose the security I have and like you.

    A catch-22 here: updated to avoid blocking-time problems and lose my security, I'm uncomfortable with OR keep my AVG security and put up with the frustration of time hang "Mozilla does not.

    You're welcome, BamaGirl.

  • Updated to 3.6. Extensions and themes stopped working. Updated to 6.0. Still does not work. Returned to 3.6. No dice. Renamed all the extension. Still does not work.

    automatically upgraded to Firefox 3.6. Extensions and themes stopped working. Updated to 6.0. Still does not work. Returned to 3.6.20. Still nothing. Renamed extension files still nothing. Help. everything worked great until the upgrade. Thems like Noia and Adblocker Plus still do not work.

    To help other users find solutions, please return to this Thread and log in to the forum with your user name and password:

    Click on 'resolved' beside the answer above that BETTER resolved your issue

    DO NOT CLICK on 'Solved It' next to this answer

  • How can I fix my toolbar? I type a website, but it does not when I hit enter or the arrow. I checked my Add ons and extensions already

    the toolbar at the top will not work. I checked Add ons extensions and I restarted. It still does not work. I tried safe mode and it didn't work either

    Maybe it's this: due to a change in the way that Firefox 39 associate keywords with bookmarks and/or history, the address bar is newly sensitive to corruption in the database that stores your history and bookmarks (the places.sqlite file).

    The developers are working on a solution, but that could take weeks to reach you.

    At this point, the best solution is to delete/rename the places.sqlite file, but then you lose all your history, if this really isn't very attractive to people who rely on history to revisit the sites.

    In case you want to try this - in case you do not receive the best suggestions - here's how:

    Open the settings folder (AKA Firefox profile) current Firefox help

    • button "3-bar" menu > "?" button > troubleshooting information
    • (menu bar) Help > troubleshooting information

    In the first table of the page, click on the view file"" button. This should launch a new window that lists the various files and folders in Windows Explorer.

    Leave this window open, switch back to Firefox and output, either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Pause while Firefox finishing its cleanup, then rename places.sqlite to something like oldplaces.sqlite. (I'm not suggesting delete this file, just in case you find yourself in need again).

    Firefox creates temporary files related to places.sqlite and those should be renamed / remove as well. Check places.sqlite - shm and places.sqlite - wal and if you find them, rename them as well.

    When you start Firefox back up again, he should start a new database places.sqlite and import your last backup automatic bookmark. Can you confirm that all your bookmarks are present? The address bar works normally again?

Maybe you are looking for