> I could then select all text, run the service, it would run the custom cleaner and clean the text. > However I was trying to make it a bit more elegant, but see no way to make a dedicated service i.e. I have put them as a custom cleaner called Writeroom and I can run the service / clean with textsoap contextual menu and then find the option, press it and it does it. > After discovering that WriteRoom text editing app was apparently putting some rubbish characters into plain text, and killing a data upload, I have got a cleaner routine to remove them in Textsoap 7. So, could anyone kindly tell me what I am doing wrong and how to fix it :) Writeroom is the name of the custom cleaner and it appears in textsoap/library under your custom cleaners. It was happy with that but the script always ends withĪ unknown token can’t go after this “end tell” yet there is no text after that when I compile it. First time I tried application "textsoap 7" to no difference and in both cases the finder asked me to show the location. ![]() Similarly with Applescript when I could just assign a key to do it. I could not even get it to run if I had selected all, copy all, run, paste all back. Inside Writeroom I could then select all text, run the service, it would run the custom cleaner and clean the text. However I was trying to make it a bit more elegant, but see no way to make a dedicated service i.e. Clearly named buttons help keep things, well, clear.After discovering that WriteRoom text editing app was apparently putting some rubbish characters into plain text, and killing a data upload, I have got a cleaner routine to remove them in Textsoap 7. For something destructive like this, we ask for confirmation by popping up a dialog box. If button returned of result is "Clear" then (Actually, to be pedantic, the default value is ¬ The default value for text item delimiters is "", the empty string. When you tell AppleScript to convert a list to text, it separates list items using a global AppleScript property called text item delimiters. We want text because we’re going to write the list to a simple text file. Next, we want to convert url_list from an AppleScript list to text. Write url_list to open_file starting at eofįirst, we create url_list, a list of the URLs from each Safari document. Open for access file prefs_file with write permission Set prefs_file to prefs_folder & "Safari Saved URLs" Set prefs_folder to path to preferences folder as string get path to prefs file where URLs will be stored Set AppleScript's text item delimiters to old_delim ![]() Set AppleScript's text item delimiters to return Set old_delim to AppleScript's text item delimiters While we’re at it, we’ll create a third script, “Clear Safari URLs”, which will simply delete the contents of the “Safari Saved URLs” file. Tell Safari to open each URL in the list. Read the “Safari Saved URLs” text file in the Preferences folder. We’ll name the second script “Restore Safari URLs”. Overwrite the previous contents of the file - we only want to remember the URLs that are open right now. Write that list to a text file named “Safari Saved URLs” in the Preferences folder. The first script, which we’ll name “Save Safari URLs”, will do the following:Ĭreate a list of URLs for each Safari document window. (Actually, I saved them in a “Safari” folder inside the Scripts folder, grouping them together in a sub-menu of the main scripts menu.) I use Apple’s system-wide script menu for Mac OS X, so I saved these scripts in the “Scripts” folder in the “Library” folder in my home directory. We can solve this problem with AppleScript. Not to mention that there’s no easy to way to add bookmarks for all open windows in one step. These aren’t URLs I want to remember forever if I were to bookmark them, I’d need to clean them out of my bookmark list later, after reading them. ![]() These are URLs I want to read once, then close. I don’t want to bookmark them - that would be overkill. I don’t want to quit, because I need to do something to remember the open URLs which I haven’t finished reading. Having all these windows open makes me reluctant to quit my browser. I typically have half a dozen or so web browser windows open at any given moment, open to URLs I mean to read in the future. By spending the time up-front to make an application scriptable, developers save time down the line, by allowing users to add new features on their own, using (relatively) simple scripts.įor example, I’ve long been annoyed by the inability of web browsers to remember which URLs were open the last time they were quit. The whole point of scriptable application software is that it allows us, the users, to add and tweak features. Save and Restore Safari URLs Monday, 3 February 2003
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |