• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Handler works only once
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handler works only once


  • Subject: Re: Handler works only once
  • From: julifos <email@hidden>
  • Date: Thu, 20 Feb 2003 21:20:46 +0100

> The purpose of the script is to rename files and folders using only
> alphanumeric characters. I wanted to put in a log as well, but I'm stuck on
> this useless error message.
> Any ideas?
>
> Rich Carroll
> email@hidden
>
> global folderName
> global goodText
> global reWrite
> global folderPath
> global newFileName
>
> on run
> set folderPath to choose folder with prompt "Select folder to be
> checked."
> set goodText to "65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78;
> 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 95; 97; 98; 99; 100; 101;
> 102; 103; 104; 105; 106; 107; 108; 109; 110; 111; 112; 113; 114; 115; 116;
> 117; 118; 119; 120; 121; 122; 49; 50; 51; 52; 53; 54; 55; 56; 57; 48"
> set reWrite to false
> set AppleScript's text item delimiters to ":"
> set folderPath to folderPath as string
> set folderName to text item -2 of folderPath as string
> wrangleName(folderName, folderPath)
> end run

Seems that you must reset applescript's text item delimiters before process
any file or do whatever.

Your current TIDs after "on run" are ":". And when you run your wrangleName,
you're manipulating strings (eg, "set newFileName to (newFileName & i) as
string").
And your "changeName" executes all of its code within a "tell finder" block;
so, perhaps, you're trying set the name of a file or folder to
"colon:forbidden"...

JJ
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Bring QuickTime Player window to the front.
  • Next by Date: Re: Log out script in 10.2.x
  • Previous by thread: Re: Handler works only once
  • Next by thread: Re: Handler works only once
  • Index(es):
    • Date
    • Thread